One-Way
爱一人,攀一山,追一梦

 

创建表:

create table hive_wordcount(context string);
load data local inpath '/home/hadoop/files/helloworld.txt' into table hive_wordcount;

执行查询SQL:

select word, count(*) from hive_wordcount lateral view explode(split(context,'\t')) wc as word group by word;

 

posted on 2017-09-18 16:27  单行道|  阅读(356)  评论(0编辑  收藏  举报