hive基本操作与应用

start-all.sh
hdfs dfs -put ~/wordcount.txt input/wordcount.txt
hive 

> create database test02;
> create table test02(content string);
> load data inpath '/user/hadoop/input/wordcount.txt' into table test02;
> create table test03 as select word, count(1) as count from (select explode(split(regexp_replace(content, ',|\\.', ' ') , ' ')) as word from test02) word group by word;
> select * from test

 

posted on 2018-05-16 21:59  182冯志坚  阅读(135)  评论(0编辑  收藏  举报

导航