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

Split Function in hive on JSONS

Split Function in hive on JSONS

Rising Star

'm handing JSON arrays in hive.I know that it can be handled with JSON serde as well but i want to do it with get_json_object or json_tuple and the regular expressions. so i was follwing the link http://mechanics.flite.com/blog/2014/04/16/using-explode-and-lateral-view-in-hive/

It gives the Json File like this {"key1":"0","key2":"11.800","info":"[{\"id\":\"1234\",\"v\":\"3\"},{\"id\":\"5678\",\"v\":\"3\"}]","key3":"3"} Why it need to have slashes in front of id and every other value??.The Observation Are like below

11400-screenshot-from-2017-01-15-232217.png

When we add the split on the regex we got from the above result we get the below things ["{\"id\":\"1234\",\"v\":\"3\"}","{\"id\":\"5678\",\"v\":\"3\"}"]

If i remove the slashes in my source Json file ebrything is coming as null.What is the possible way to get out of this.

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