Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Need help with sqoop

avatar
New Contributor

Hi,

 

I am trying to launch the below sqoop job from terminal editor but I am getting Error: expected numeric argument.
Try --help for usage.

 

Please help.

 

sqoop import-all-tables \
    -m {{cluster_data.worker_node_hostname.length}} \
    --connect jdbc:mysql://{{cluster_data.manager_node_hostname}}:3306/retail_db \
    --username=retail_dba \
    --password=cloudera \
    --compression-codec=snappy \
    --as-parquetfile \
    --warehouse-dir=/user/hive/warehouse \
    --hive-import

 

Thanks,

Sundar.

1 ACCEPTED SOLUTION

avatar
New Contributor

 

Thank you Somu.

 

Thanks,

Sundar.

 

 

View solution in original post

4 REPLIES 4

avatar
Rising Star

sqoop import-all-tables \
    -m {{cluster_data.worker_node_hostname.length}} \
    --connect jdbc:mysql://{{cluster_data.manager_node_hostname}​}:3306/retail_db \
    --username=retail_dba \
    --password=cloudera \
    --compression-codec=snappy \
    --as-parquetfile \
    --warehouse-dir=/user/hive/warehouse \
    --hive-import

 

-m --> Expects no of mapper. May be your variable is not getting converted to numeric value

 

try 1 or 2 instead ie -m 1


@smarudai wrote:

Hi,

 

I am trying to launch the below sqoop job from terminal editor but I am getting Error: expected numeric argument.
Try --help for usage.

 

Please help.

 

sqoop import-all-tables \
    -m {{cluster_data.worker_node_hostname.length}} \
    --connect jdbc:mysql://{{cluster_data.manager_node_hostname}}:3306/retail_db \
    --username=retail_dba \
    --password=cloudera \
    --compression-codec=snappy \
    --as-parquetfile \
    --warehouse-dir=/user/hive/warehouse \
    --hive-import

 

Thanks,

Sundar.


 

 

avatar
New Contributor

 

Thank you Somu.

 

Thanks,

Sundar.

 

 

avatar
Explorer

sorry boss,

 

your post is the recommended solution, but its not working wiht me i've tried both m 1 and m1 but not working

 

appreciate your prompt reply

==========================

[cloudera@quickstart ~]$ sqoop import-all-tables     -m 1 {{cluster_data.worker_node_hostname.length}}     --connect jdbc:mysql://{{cluster_data.manager_node_hostname}}:3306/retail_db     --username=retail_dba     --password=cloudera     --compression-codec=snappy     --as-parquetfile     --warehouse-dir=/user/hive/warehouse     --hive-import
Warning: /usr/lib/sqoop/../accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
16/09/15 18:02:52 INFO sqoop.Sqoop: Running Sqoop version: 1.4.5-cdh5.4.2
16/09/15 18:02:52 ERROR tool.BaseSqoopTool: Error parsing arguments for import-all-tables:
16/09/15 18:02:52 ERROR tool.BaseSqoopTool: Unrecognized argument: {{cluster_data.worker_node_hostname.length}}
16/09/15 18:02:52 ERROR tool.BaseSqoopTool: Unrecognized argument: --connect
16/09/15 18:02:52 ERROR tool.BaseSqoopTool: Unrecognized argument: jdbc:mysql://{{cluster_data.manager_node_hostname}}:3306/retail_db
16/09/15 18:02:52 ERROR tool.BaseSqoopTool: Unrecognized argument: --username
16/09/15 18:02:52 ERROR tool.BaseSqoopTool: Unrecognized argument: retail_dba
16/09/15 18:02:52 ERROR tool.BaseSqoopTool: Unrecognized argument: --password
16/09/15 18:02:52 ERROR tool.BaseSqoopTool: Unrecognized argument: cloudera
16/09/15 18:02:52 ERROR tool.BaseSqoopTool: Unrecognized argument: --compression-codec
16/09/15 18:02:52 ERROR tool.BaseSqoopTool: Unrecognized argument: snappy
16/09/15 18:02:52 ERROR tool.BaseSqoopTool: Unrecognized argument: --as-parquetfile
16/09/15 18:02:52 ERROR tool.BaseSqoopTool: Unrecognized argument: --warehouse-dir
16/09/15 18:02:52 ERROR tool.BaseSqoopTool: Unrecognized argument: /user/hive/warehouse
16/09/15 18:02:52 ERROR tool.BaseSqoopTool: Unrecognized argument: --hive-import

Try --help for usage instructions.

avatar
Champion

-m 1 is the correct one (do not use -m1). But as per your code you are using -m 1 along with {{cluster_data.worker_node_hostname.length}} 

 

remove {{cluster_data.worker_node_hostname.length}}  and try again only with -m 1

 

also i would recommand to practice with import instead of import-all-tables. Becuase you can customize "-m {{cluster_data.worker_node_hostname.length}}" with different size based on your file/table size (like -m 2, -m 3, etc)