I wanted to Create hive table with Json array I am facing issue with top level array. can anyone suggest me a solution. My json object looks like below
[{"user_id": "a"," previous_user_id": "b"},{"user_id": "c"," previous_user_id": "d"},{"user_id": "e"," previous_user_id": "f"}]
Hive command to create the table:
create external table array_tmp (User array<struct<user_id: String, previous_user_id:String>>)
ROW FORMAT SERDE 'org.openx.data.jsonserde.JsonSerDe'
select user.user_id from array_tmp
gives exception as
Row is not a valid JSON Object.
I have added the jar ADD JAR json-serde-1.3.8-jar-with-dependencies.jar; Any suggestion ?