1. 数据下载:从hive命令行导出表数据到txt
hive -e 'select * from dim.dim_city' >> dim_city.txt
hive -e "select * from app.app_cmo_user_buyview_kpi_report_di where dt='2016-03'" >> app_cmo_user_buyview_kpi_report_di_2016-03.txt
2. 数据上传:load文件至hadp
ssh hadp@192.168.193.84
123456
hive
load data local inpath '/home/hadp/niewj/app_report_di_2016-03.txt' overwrite into table cmo_app.app_report_di partition (dt='2016-03');
load data local inpath '/home/hadp/wenxiaomin/app_cmo_datacube4_ord_type_det_sum_di1.txt' overwrite into table cmo_app.app_cmo_datacube4_ord_type_det_sum_di partition (dt='2016-02-02',tp='1');
load data local inpath '/home/hadp/wenxiaomin/app_cmo_coupon_send_dept_di.txt' overwrite into table cmo_app.app_cmo_coupon_send_dept_di partition (dt='2016-02-02');
load data local inpath '/home/hadp/niewj/app_cmo_user_buyview_lv_cd_kpi_di.txt' overwrite into table cmo_app.app_cmo_user_buyview_lv_cd_kpi_di partition (dt='2015-01');
[2016-09-20]
转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 hi@niewj.com