如何从HIVE中的Array <string>中提取单列???

时间:2017-09-27 07:25:04

标签: json hive arrayofstring

我必须在HIVE中从这个数组中提取timeStamp列吗? [{&#34; timeStamp&#34;:1506411499989,&#34; status&#34;:&#34; BROADCASTED&#34;}]

2 个答案:

答案 0 :(得分:0)

使用explode功能,然后从爆炸表/视图中选择时间戳

答案 1 :(得分:0)

使用lateral view + explodeget_json_object

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