Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSON SerDe for Hive that supports JSON arrays

I have tried the JSON SerDe that Amazon provides for EMR instance and works great if you need to address/map JSON dictionary fields to columns. However I wasn't been able to figure how to do the same with JSON arrays. For example if there is a JSON array as follows:

[23123.32, "Text Text", { "key1": "value1" } ]

Is there a way to map the first element of an array to a column in Hive table? What about the embedded dictionary fields?

like image 806
Alex N. Avatar asked Jun 10 '12 04:06

Alex N.


1 Answers

I was struggling with the same problem till I found this serde on github - https://github.com/rcongiu/Hive-JSON-Serde Just include it using the 'add jar' command once you start hive and it works like a charm.

like image 115
pmohan6 Avatar answered Sep 25 '22 04:09

pmohan6