hive function get_json_object

pandas and SQL data analysis combat

https://study.163.com/course/courseMain.htm?courseId=1006383008&share=2&shareId=400000000398149

Reproduced

https://www.cnblogs.com/drjava/p/10486134.html

 

hive provides json analytic functions: get_json_object

 

Instructions

For jsonArray (json array), as xjson person table has data fields:

[{"name":"王二狗","sex":"男","age":"25"},{"name":"李狗嗨","sex":"男","age":"47"}]

Json take the first object is then hive sql:

SELECT get_json_object(xjson,"$.[0]") FROM person;

 The result is:

{"name":"王二狗","sex":"男","age":"25"}

Retrieves the first of the age field value json:

SELECT get_json_object(xjson,"$.[0].age") FROM person;

result

25

 

to sum up

get_json_object(param1,"$.param2")

 

 python mining machine learning -sklearn breast cancer cells (bloggers personally Record)

Netease cloud watch address

https://study.163.com/course/introduction.htm?courseId=1005269003&utm_campaign=commission&utm_source=cp-400000000398149&utm_medium=share

Sweep the two-dimensional code, attention bloggers homepage to learn more knowledge of Python

https://m.study.163.com/user/1135726305.htm?utm_campaign=share&utm_medium=iphoneShare&utm_source=weixin&utm_u=1015941113

Guess you like

Origin www.cnblogs.com/webRobot/p/11301276.html