3

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

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.