三步骤
一、创建表
create table textlines(line string)
二、加载数据
load data inpath '/sty/wordcount/input/a.txt' overwrite into table textlines
三、查询
SELECT word,count(1) AS count FROM (SELECT explode(split(line,'[ \t]+') ) AS word FROM textlines ) w GROUP BY word ORDER BY word;
视频操作 点击播放或下载
(转载本站文章请注明作者和出处 使用Hive处理WordCount )