Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Sqoop: quick guide to --auto-reset-to-one-mapper

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


This post first appeared on Java Tutorial : Blog To Learn Java Programming, please read the originial post: here

Share the post

Sqoop: quick guide to --auto-reset-to-one-mapper

×

Subscribe to Java Tutorial : Blog To Learn Java Programming

Get updates delivered right to your inbox!

Thank you for your subscription

×