You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Buntu Dev <bu...@gmail.com> on 2016/01/20 23:03:54 UTC
Convert string to map
I got json string of the form:
{"k1":"v1","k2":"v2,"k3":"v3"}
How would I go about converting this to a map<string, string>?
Thanks!
Re: Convert string to map
Posted by Edward Capriolo <ed...@gmail.com>.
create table xxxx ()..
[COLLECTION ITEMS TERMINATED BY char]
[MAP KEYS TERMINATED BY char]
collection items terminated by ',' map keys terminated by ':' works in many
cases
On Wed, Jan 20, 2016 at 9:07 PM, Buntu Dev <bu...@gmail.com> wrote:
> I found the brickhouse Hive udf `json_map' that seems to convert to map of
> given type.
>
> Thanks!
>
> On Wed, Jan 20, 2016 at 2:03 PM, Buntu Dev <bu...@gmail.com> wrote:
>
>> I got json string of the form:
>>
>> {"k1":"v1","k2":"v2,"k3":"v3"}
>>
>> How would I go about converting this to a map<string, string>?
>>
>> Thanks!
>>
>
>
Re: Convert string to map
Posted by Buntu Dev <bu...@gmail.com>.
I found the brickhouse Hive udf `json_map' that seems to convert to map of
given type.
Thanks!
On Wed, Jan 20, 2016 at 2:03 PM, Buntu Dev <bu...@gmail.com> wrote:
> I got json string of the form:
>
> {"k1":"v1","k2":"v2,"k3":"v3"}
>
> How would I go about converting this to a map<string, string>?
>
> Thanks!
>