一个更加复杂的实例

创建表

hive> create table sgr(qtime string, qid string, qword string, url string) row format delimited fields terminated by ',';
hive> desc sgr;
OK
qtime                   string                                      
qid                     string                                      
qword                   string                                      
url                     string                                      
Time taken: 0.086 seconds, Fetched: 4 row(s)

加载数据

hive> load data inpath '/sougou.dic' into table sgr;

热搜榜

hive>create table sgr_results as select keyword, count(1) as count from (select qword as keyword from sgr) t group by keyword order by count desc;

查询结果

hive> select * from sgr_results limit 10;

你可能感兴趣的:(一个更加复杂的实例)