hive Interview Series

Import data
mianshi.txt


A,2015-01,5
A,2015-01,15
B,2015-01,5
A,2015-01,8
B,2015-01,25
A,2015-01,5
A,2015-02,4
A,2015-02,6
B,2015-02,10
B,2015-02,5
A,2015-03,16
A,2015-03,22
B,2015-03,23
B,2015-03,10
B,2015-03,1
create external table if not exists t_access(
uname string comment '用户名',
umonth string comment '月份',
ucount int comment '访问次数'
) comment '用户访问表' 
row format delimited fields terminated by "," 
location "/hive/t_access"; 
load data local inpath "/home/hadoop/apps/mianshi.txt" into table t_access;

结果需求

Guess you like

Origin blog.csdn.net/weixin_42177380/article/details/91404885
Recommended