I have one column in hive table wherein I have stored entire json data map as string. I am using get_json_object to fetch each element of json. However I have one element which is array of structs. I need to explode that array of structs.
Entire evtDataMap is stored in a hive column and I want the output like
Basically I want to flatten the array of structs.
I am using query like this
with temp as(
select evName,get_json_object(evtDataMap,'$.ucmEvt.rscDrvdStateEntMap')as mapp from avaya.jmsrec_temp where evtName ='USER')
Select evtName, a.prov_id,a.acct_Id,a.chanlTypeId ,a.derivedAvlFlg,a.activeWrkCnt,a.avlState,a.workLimit from temp lateral view inline(temp.mapp) a as prov_id,acct_Id,chanlTypeId ,derivedAvlFlg,activeWrkCnt,avlState,workLimit
eventName is a hive table column.I am getting an error as
"FAILED: UDFArgumentException Top level object must be an array but was string"
Tried array over get_json_object but still I am getting an error