Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Json to hive convertion


Re: Json to hive convertion

New Contributor

I am facing similar issue with top level array. can anyone suggest me a solution.

[{"user_id": "a"," previous_user_id": "b"},{"user_id": "c"," previous_user_id": "d"},{"user_id": "e"," previous_user_id": "f"}]
create external table array_tmp (User array<struct<user_id: String, previous_user_id:String>>) ROW FORMAT SERDE ''

on executing below

select user.user_id from array_tmp


it gives exception as Row is not a valid JSON Object. I followed what is there in But no luck for top level arrays. Any help is much appreciated

Don't have an account?
Coming from Hortonworks? Activate your account here