Sqoop import-all-tables

#1

Hello Team,
can anyone help me with the below scenario.

“what if in my mysql database i have multiple tables with some tables having primary key and some not having primary keys then what should be the sqoop import query. for this case lets assume we have just 2 tables , one having primary key and the other not having primary key and i want to import both the tbales to HDFS”

thank you

1 Like

#2

You need to use --autoreset-to-one-mapper. If there is no primary key for a table it will use only 1 mapper to load the respective table. For tables which have primary key it will use 4 mappers (default) or the value specified using -m or --num-mappers.

0 Likes

#3

Thank you . i am using an older version of sqoop 1.4.4 , i think --autoreset doesnt work in this version.
i will download the updated version and check again.

0 Likes

#4

Yes, it is part of 1.4.6.

0 Likes