如何 select hive table 的一列中的字典中的某些值?

How to select only some values form dictionary in one of column of hive table?

假设这是我的蜂巢 table

A B C
a1 {'age':0,'name':b1, 'id':100} c1
a2 {'age':1,'name':b2, 'id':200} c2
a3 {'age':2,'name':b3, 'id':300} c3
如何select只有这个
age name
0 b1
1 b2
2 b3
在散列 table

上使用 SQL 查询

要获得您想要的结果,您可以使用以下查询:

SELECT get_json_object(B,'$.age')  as age,
       get_json_object(B,'$.name') as name
FROM table_name

其中 B 是您的列名称