You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hive.apache.org by Sha Liu <li...@hotmail.com> on 2013/08/15 23:05:56 UTC

Hive UDF converting structs to JSON strings

Hi Hive Gurus,

Is there a Hive UDF (built-in or 3rd party) that takes a struct and converts 
it to a JSON string?

Queries display structs fine, but when inserting struct columns into a table 
where the corresponding columns are typed as strings, the format is gone and 
all field name and values are just concatenated together (at least for Hive 
0.9.0 that I'm using).

For my case it is relevantly easy to construct JSON strings by myself, but I 
wonder if there is a more standardized way to do so.

Thanks,
Sha Liu