sqoop
作者:互联网
sqoop查看所有库:
sqoop list-databases --connect jdbc:mysql://hadoop102:3306 --username root --password 123456
将表按照指定需求导入HDFS
sqoop import \
--connect jdbc:mysql://hadoop102:3306/gmall \
--username root \
--password 123456 \
--table user_info \
--columns id,login_name,nick_name \
--where "id >=100 and id <=200" \
--target-dir /testsqoop \
--delete-target-dir \
--num-mappers 2 \
--fields-terminated-by "\t"
或者
sqoop import \
--connect jdbc:mysql://hadoop102:3306/gmall \
--username root \
--password 123456 \
--query "select id,login_name,nick_name from user_info where id >=100 and id <=200 and \$CONDITIONS " \
--target-dir /testsqoop \
--delete-target-dir \
--num-mappers 2 \
--split-by id \
--fields-terminated-by "\t"
标签:name,--,sqoop,id,dir,target 来源: https://www.cnblogs.com/kiku-58546494/p/16263959.html