What is the easiest way in Apache Hive to convert a Map (String, String) to a string representation in json format?
I've tried reflect and the JSONValue class, but it seems that the reflect udf only accepts primitives datatypes...
Your help is highly appreciated.
Kind regards Dennis
Just use the "to_json" UDF from Brickhouse. ( http://github.com/klout/brickhouse ). It converts any arbitrary Hive structure into valid JSON. You can also parse arbitrary JSON formats into Hive structures with the "from_json" UDF.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With