热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

本地执行sqoop和oozie上执行sqoop命令需要注意

-------------------------------------------本地sqoop命令,需要修改为\N、并且添加sqoop前缀--------------------------

-------------------------------------------本地sqoop命令,需要修改为'\N'、并且添加sqoop前缀-------------------------------------------
#采购订单
sqoop export --connect jdbc:mysql://192.168.1.109/testtests?characterEncoding=utf8 --username root --password123456 --table A_JQZ_T_GAS_GET_ORDER_NUM_INFO_S  --export-dir  /user/hive/warehouse/origin_ennenergy_energytrade.db/a_jqz_t_gas_get_order_num_info_s  --input-null-string '\N' --input-null-non-string'\N' --fields-terminated-by ''\t'' --update-mode allowinsert --update-key order_num,times


#在途库存
sqoop export --connect jdbc:mysql://192.168.1.109/testtests?characterEncoding=utf8 --username root --password123456 --table A_JQZ_T_GAS_TOTAL_STORAGE_INFO_S  --export-dir  /user/hive/warehouse/origin_ennenergy_energytrade.db/a_jqz_t_gas_total_storage_info_s  --input-null-string '\N' --input-null-non-string'\N' --fields-terminated-by ''\t'' --update-mode allowinsert --update-key  station_no,gather_time


#地区信息表
sqoop export --connect jdbc:mysql://192.168.1.109/testtests?characterEncoding=utf8 --username root --password123456 --table A_JQZ_T_GAS_AREA_DATA_INFO_M      --export-dir  /user/hive/warehouse/origin_ennenergy_energytrade.db/a_jqz_t_gas_area_data_info_m  --input-null-string '\N' --input-null-non-string'\N' --fields-terminated-by ''\t'' --update-mode allowinsert --update-key  order_id,order_num


#当前销售额和销售单数
sqoop export --connect jdbc:mysql://192.168.1.109/testtests?characterEncoding=utf8 --username root --password123456 --table A_YKT_T_GAS_ORDER_INFO_M          --export-dir  /user/hive/warehouse/origin_ennenergy_onecard_lng.db/a_ykt_t_gas_order_info_m     --input-fields-terminated-by ''\t'' --update-mode allowinsert --update-key FStationNo,FTradeDateTime


#平均消耗
sqoop export --connect jdbc:mysql://192.168.1.109/testtests?characterEncoding=utf8 --username root --password123456 --table A_YKT_T_GAS_AVG_USED_INFO_S       --export-dir  /user/hive/warehouse/origin_ennenergy_onecard_lng.db/a_ykt_t_gas_avg_used_info_s  --input-fields-terminated-by '\t' --input-null-string '\N' --input-null-non-string'\N' --fields-terminated-by ''\t'' --update-mode allowinsert --update-key FStationNo,calculation_time


#【新增】导出custom对应站点关系
sqoop export --connect jdbc:mysql://192.168.1.109/testtests?characterEncoding=utf8 --username root --password123456 --table C_NY_C_CUST_GAS_STATION_M         --export-dir  /user/hive/warehouse/origin_ennenergy_energytrade.db/c_ny_c_cust_gas_station_m    --input-null-string '\N' --input-null-non-string'\N' --fields-terminated-by ''\t'' --update-mode allowinsert --update-key  CUST_STATION_ID,CUSTOMER_ID




-----------------------------------------------oozie上则需要全部使用双引号--------------------------------------------
#采购订单
export --connect jdbc:mysql://192.168.1.109/testtests?characterEncoding=utf8 --username root --password 123456 --table A_JQZ_T_GAS_GET_ORDER_NUM_INFO_S  --export-dir  /user/hive/warehouse/origin_ennenergy_energytrade.db/a_jqz_t_gas_get_order_num_info_s  --input-null-string "\\N" --input-null-non-string "\\N" --fields-terminated-by "\t" --update-mode allowinsert --update-key order_num,times


#在途库存
export --connect jdbc:mysql://192.168.1.109/testtests?characterEncoding=utf8 --username root --password123456  --table A_JQZ_T_GAS_TOTAL_STORAGE_INFO_S  --export-dir  /user/hive/warehouse/origin_ennenergy_energytrade.db/a_jqz_t_gas_total_storage_info_s  --input-null-string "\\N" --input-null-non-string "\\N" --fields-terminated-by "\t" --update-mode allowinsert --update-key  station_no,gather_time


#地区信息表
export --connect jdbc:mysql://192.168.1.109/testtests?characterEncoding=utf8 --username root --password123456 --table A_JQZ_T_GAS_AREA_DATA_INFO_M      --export-dir  /user/hive/warehouse/origin_ennenergy_energytrade.db/a_jqz_t_gas_area_data_info_m  --input-null-string "\\N" --input-null-non-string "\\N" --fields-terminated-by "\t" --update-mode allowinsert --update-key  order_id,order_num


#当前销售额和销售单数
export --connect jdbc:mysql://192.168.1.109/testtests?characterEncoding=utf8 --username root --password123456 --table A_YKT_T_GAS_ORDER_INFO_M          --export-dir  /user/hive/warehouse/origin_ennenergy_onecard_lng.db/a_ykt_t_gas_order_info_m     --input-fields-terminated-by "\t" --update-mode allowinsert --update-key FStationNo,FTradeDateTime


#平均消耗
export --connect jdbc:mysql://192.168.1.109/testtests?characterEncoding=utf8 --username root --password123456  --table A_YKT_T_GAS_AVG_USED_INFO_S       --export-dir  /user/hive/warehouse/origin_ennenergy_onecard_lng.db/a_ykt_t_gas_avg_used_info_s  --input-fields-terminated-by "\t" --input-null-string "\\N" --input-null-non-string "\\N" --fields-terminated-by "\t" --update-mode allowinsert --update-key FStationNo,calculation_time


#【新增】导出custom对应站点关系

export --connect jdbc:mysql://192.168.1.109/testtests?characterEncoding=utf8 --username root --password123456 --table C_NY_C_CUST_GAS_STATION_M         --export-dir  /user/hive/warehouse/origin_ennenergy_energytrade.db/c_ny_c_cust_gas_station_m    --input-null-string "\\N" --input-null-non-string "\\N" --fields-terminated-by "\t" --update-mode allowinsert --update-key  CUST_STATION_ID,CUSTOMER_ID











推荐阅读
author-avatar
mobiledu2502885053
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有