记录一个hive清空外部表数据的办法

insert overwrite table access select * from access where ip =0;

insert into mydb2.upflow select ip,sum(upflow) as sum from mydb2.access group by ip order by sum desc

create external table mydb2.upflow (ip string,sum string) row format delimited fields terminated by ',';

sqoop export --connect jdbc:mysql://hadoop2:3306/userdb --username sqoop --password sqoop --table upflow --export-dir /usr/local/software/hive/warehouse/mydb2.db/upflow --input-fields-terminated-by ','

posted on 2020-08-07 16:13  清浊  阅读(2115)  评论(0)    收藏  举报