I have the following nested JSON format data stored as syslog which I need to query using HiveQL and convert into a CSV file (which would be used to display a graph) :
"logAggregate": {"name-1":{"time":"74","count":"1"},"name-2":{"time":"2","count":"1"},"name-3 {"time":"2","count":"5"},"name-4":{"time":"22","count":"1"},
。
。
。// and so on..
。}
The output format I am looking for is something like below:
name-1 time
name-2 time
name-3 time
.
.
. // so on
I am relatively new to Hive so not sure how I should parse this JSON data. I tried fiddling with Lateral View and json_tuple but in vain!
Any help would be much apppreciated!
json-serdeto define the table and load the data. The details are here. Try this and update the question if you facing any issue.