Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

Error parsing arguments by using Oozie with Sqoop and Hive import

Hello all,

I have this below action Oozie workflow but I keep getting these error:

ERROR org.apache.sqoop.tool.BaseSqoopTool - Error parsing arguments for import:

ERROR org.apache.sqoop.tool.BaseSqoopTool - Unrecognized argument: --hive-drop-import-delimns

ERROR org.apache.sqoop.tool.BaseSqoopTool - Unrecognized argument: --hive-overwrite

ERROR org.apache.sqoop.tool.BaseSqoopTool - Unrecognized argument: --hive-table

ERROR org.apache.sqoop.tool.BaseSqoopTool - Unrecognized argument: test_tmp

ERROR org.apache.sqoop.tool.BaseSqoopTool - Unrecognized argument: --target-dir

ERROR org.apache.sqoop.tool.BaseSqoopTool - Unrecognized argument: /apps/hive/warehouse/test

ERROR org.apache.sqoop.tool.BaseSqoopTool - Unrecognized argument: -m

ERROR org.apache.sqoop.tool.BaseSqoopTool - Unrecognized argument: 1

----------------------------- Oozie Workflow ----------------------------

<action name="sqoop-node">

<sqoop xmlns="uri:oozie:sqoop-action:0.2">

<job-tracker>${jobTracker}</job-tracker>

<name-node>${nameNode}</name-node>

<prepare>

<delete path="hdfs://localhost/test-oozie/examples/output-data/sqoop"/>

<mkdir path="hdfs://localhost/test-oozie/examples/output-data"/> </prepare>

<configuration>

<property> <name>mapred.job.queue.name</name>

<value>${queueName}</value> </property> </configuration>

<arg>import</arg>

<arg>--connect</arg>

<arg>jdbc:oracle:thin:</arg>

<arg>--username</arg>

<arg>user</arg>

<arg>--password</arg>

<arg>pwd</arg>

<arg>--query</arg>

<arg>SELECT * FROM MYTASK WHERE STARTTIME BETWEEN TO_DATE('2017-06-08 14:00:00', 'YYYY-MM-DD HH24:MI:SS') AND TO_DATE('2017-06-08 14:10:59','YYYY-MM-DD HH24:MI:SS') AND $CONDITIONS)</arg>

<arg>--hive-import</arg>

<arg>--hive-drop-import-delimns</arg>

<arg>--hive-overwrite</arg>

<arg>--hive-table</arg>

<arg>test_tmp</arg>

<arg>--target-dir</arg>

<arg>/apps/hive/warehouse/test</arg>

<arg>-m</arg>

<arg>1</arg>

Would you please help me why I got the Unrecognized argument ?

Thank you for your help.

JT

1 REPLY 1

Explorer

This looks like it could be due to a typo in one of your arguments. Your workflow contains "--hive-drop-import-delimns" (note the "n" as the second to last character), but according to the sqoop documentation, this should be "--hive-drop-import-delims". Can you try correcting that and see if your job successfully parses?

Source: https://sqoop.apache.org/docs/1.4.1-incubating/SqoopUserGuide.html#_importing_data_into_hive

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.