num-mappers能够指定mapper运行计算数量,当指定为1时,能够不用设置split-by参数,不指定num-mappers时,默认为4,当不指定或者num-mappers大于1时,须要指定split-by参数。例子以下:mysql
使用查询语句(--e或--query)导入时,须要指定--split-by参数及--target-dir参数;
When importing query results in parallel, you must specify --split-by. Must specify destination with --target-dir.
sql
sqoop import --connect connect jdbc:mysql://114.215xx.xx.xx:3306/crawler_data \ app
--username test --password test \oop
--e 'select * from T_SQOOP_TEST where $CONDITIONS' --verbose --split-by id --target-dir temp3 --m 1ci