Support Questions

Find answers, ask questions, and share your expertise

What does --m 1 represent in sqoop import statement? Below is the code.

avatar
$ sqoop import \
--connect jdbc:mysql://localhost/userdb \
--username root \
--table emp --m 1
1 ACCEPTED SOLUTION

avatar

@Sudharsan Ganeshkumar

-m represents the number of mappers run to extract the data from the source database. Here '-m 1' means running one mapper.

View solution in original post

6 REPLIES 6

avatar

@Sudharsan Ganeshkumar

-m represents the number of mappers run to extract the data from the source database. Here '-m 1' means running one mapper.

avatar

@Sindhu If I increase the mappers, will the time consumed be less or How many mappers can we keep in general ??? Thanks!

avatar
Expert Contributor

@Sudharsan Ganeshkumar

The optimal number of mappers depends on many variables: you need to take into account your database type, the hardware that is used for your database server, and the impact to other requests that your database needs to serve. There is no optimal number of mappers that works for all scenarios. Instead, you’re encouraged to experiment to find the optimal degree of parallelism for your environment and use case. It’s a good idea to start with a small number of mappers, slowly ramping up, rather than to start with a large number of mappers, working your way down.

When you run sqoop import with -m 1 option, 1 mapper will be launched and in case this parameter is specified, sqoop will run 4 mappers by default.

avatar
Super Collaborator

Hi @Sudharsan Ganeshkumar,

-m denotes number of mappers to launch to run your query.

avatar

@Sudharsan Ganeshkumar
Yes, you can increase the number of mappers to improve parallelism depending on your cluster resources.

avatar

@Sudharsan Ganeshkumar
Yes, you can increase the number of mappers to improve parallelism depending on your cluster resources.