2 hive 函数
hive wordcount
#####hive中的wordcount # 原始数据 /opt/data/words.txt # 创建表 create table words(name string); # 加载数据 load data local inpath '/opt/data/words.txt' into table words; # 查询表中的数据 select * from words;
1.先spilt
2. 炸裂explode
3. group by 统计
select wd, count(*) num from (select explode(split(name,',')) wd from words)t1 group by wd;
有疑问可以加wx:18179641802,进行探讨