how can I extract single column from Array <String> in HIVE???

553 Views Asked by At

I have to extract timeStamp column from this Array in HIVE? [{"timeStamp":1506411499989,"status":"BROADCASTED"}]

2

There are 2 best solutions below

0
On

Use explode function and then select the timestamp from the exploded table/view

0
On

Use lateral view+explode and get_json_object:

select s.*, get_json_object(a.your_json,'$.timeStamp') as timeStamp
  from your_table s
       lateral view outer explode (your_Array) a;