1、非分区表
sqoop import --connect 'jdbc:mysql://node03:3306/zp_sys?useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=GMT%2b8&tinyInt1isBit=false&CatalogOptions=0;NumberPrecisionScale=1' --username root --password 'Changxin*8' --query "select * from sys_file_depot where 1=1 and $CONDITIONS " --hive-import --as-textfile --null-string '\N' --null-non-string '\N' --hive-overwrite --delete-target-dir --target-dir /user/hive/warehouse/rcdn_stg/stg_rcdn_sys_file_depot --hive-database rcdn_stg --hive-table stg_rcdn_sys_file_depot --fields-terminated-by '|' --hive-delims-replacement "" -m 1
2、分区表
sqoop import --connect 'jdbc:mysql://node03:3306/rc?useUnicode=true&characterEncoding=UTF-8&useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=GMT%2b8&tinyInt1isBit=false&CatalogOptions=0;NumberPrecisionScale=1' --username root --password 'Changxin*8' --query "select * from zc_HBRMZCGW where 1=1 and $CONDITIONS " --map-column-hive content=String --hive-import --as-textfile --null-string '\N' --null-non-string '\N' --hive-overwrite --delete-target-dir --target-dir /user/hive/warehouse/rcdn_stg/stg_rcdn_zc_hbrmzcgw --hive-database rcdn_stg --hive-table stg_rcdn_zc_hbrmzcgw --fields-terminated-by '|' --hive-delims-replacement "" --hive-partition-key batch_no --hive-partition-value 20211226 -m 1