对码当歌,猿生几何?

Hive常用函数

1.修改表:ALTER TABLE table_name SET TBLPROPERTIES('comment' = '这是表注释!');

2.修改字段:

ALTER TABLE table_name CHANGE COLUMN muid muid_new STRING COMMENT '这里是列注释!'; 

3.json字段解析(get_json_object)

select

    date,

    url,

    get_json_object(`extract_json`, '$.text') as `text`,

    get_json_object( get_json_object(`extract_json`, '$.status'),'$.play_count') as `play_count`,

    get_json_object(`extract_json`, '$.id') as `id`

from

    default.vertical_crawler_result_daily

where

    date = '20171201'and seed_id = 132

阅读更多