Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

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

Solved Go to solution

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

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

Accepted Solutions
Highlighted

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

@Sudharsan Ganeshkumar

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

6 REPLIES 6
Highlighted

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

@Sudharsan Ganeshkumar

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

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

New Contributor

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

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

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.

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

Super Collaborator

Hi @Sudharsan Ganeshkumar,

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

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

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

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

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

Don't have an account?
Coming from Hortonworks? Activate your account here