在 虚拟机 或是 服务器 编写 简单版本的 Hive的词频统计:
【相信此时的你,hive 环境已搭建好,来个简单的案例吧!】
① 在服务器,编辑文本 words.txt:
vi words.txt
zhangsan is beijing
zhangsan is running
country
nihao hi love hi
② 进到hive进行建表:
hive> create table wc(txt String) row format delimited fields terminated by '\t';
③ 导数据:
hive> load data local inpath '/root/words.txt' overwrite into table wc;