In general, --auto-reset-to-one-mapper option and -num-mappers are used together.
--autoreset-to-one-mapper \
--num-mappers 3
Above snippet specifies, if a table has primary key, then use 3 mappers, else use one mapper.
Example
sqoop-import-all-tables \
--connect "jdbc:mysql://quickstart.cloudera:3306/import_demo" \
--username "root" \
--password "cloudera" \
--warehouse-dir /import_database_demo \
--autoreset-to-one-mapper \
--num-mappers 3
Above command copy the content of all tables in ‘import_demo’ databases to the folder /import_database_demo_2. If a table has primary key, then 3 mappers will be used, else one mapper is used.
Previous Next Home
No comments:
Post a Comment