You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Aleksei Udatšnõi <a....@gmail.com> on 2012/08/29 15:49:35 UTC
Convert JSON array to Hive array
I have a Hive column with JSON string like:
["9835","29825","73432","51365","14114","6527","779"]
I want to explode() it and use with the LATERAL VIEW. For that it
needs to be a Hive array. Is there any quick way to convert this
string into a Hive array?
Re: Convert JSON array to Hive array
Posted by Aleksei Udatšnõi <a....@gmail.com>.
Unfortunately get_json_object return the string and not a Hive array.
On Wed, Aug 29, 2012 at 5:30 PM, Tom Brown <to...@gmail.com> wrote:
> I believe the "get_json_object" function will be suitable (though I've
> never personally tried it in the exact context you describe.)
>
> https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-getjsonobject
>
> --Tom
>
> On Wed, Aug 29, 2012 at 7:49 AM, Aleksei Udatšnõi <a....@gmail.com> wrote:
>> I have a Hive column with JSON string like:
>>
>> ["9835","29825","73432","51365","14114","6527","779"]
>>
>> I want to explode() it and use with the LATERAL VIEW. For that it
>> needs to be a Hive array. Is there any quick way to convert this
>> string into a Hive array?
Re: Convert JSON array to Hive array
Posted by Tom Brown <to...@gmail.com>.
I believe the "get_json_object" function will be suitable (though I've
never personally tried it in the exact context you describe.)
https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-getjsonobject
--Tom
On Wed, Aug 29, 2012 at 7:49 AM, Aleksei Udatšnõi <a....@gmail.com> wrote:
> I have a Hive column with JSON string like:
>
> ["9835","29825","73432","51365","14114","6527","779"]
>
> I want to explode() it and use with the LATERAL VIEW. For that it
> needs to be a Hive array. Is there any quick way to convert this
> string into a Hive array?