Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]
Created on 10-20-2015 12:01 PM - edited 09-16-2022 02:44 AM
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.
Created 10-20-2015 12:41 PM
Created 10-20-2015 12:37 PM
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.
Created 10-20-2015 12:41 PM
Thank you Somu.
Thanks,
Sundar.
Created 09-15-2016 06:12 PM
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.
Created 11-14-2016 01:49 PM
-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)