欢迎您访问365答案网,请分享给你的朋友!
生活常识 学习资料

sqoopimportquery

时间:2023-06-20

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

Copyright © 2016-2020 www.365daan.com All Rights Reserved. 365答案网 版权所有 备案号:

部分内容来自互联网,版权归原作者所有,如有冒犯请联系我们,我们将在三个工作时内妥善处理。