實作語句如下:
sqoop export --connect jdbc:mysql://ip:3306/eqpt_base_db?characterEncoding=utf8 --username root --password secret_password --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'
為了避免空值時,沒有資料,需要以下指令:
--input-null-string '\\N' --input-null-non-string '\\N' --fields-terminated-by '\t'