Search code examples
sqoop

sqoop job --create getting Errored out


Here I am trying to create a sqoop Job,but its throwing error FYI : When I tried direct sqoop import it works fine. But When I need to create a job for this , at that time its showing error

sqoop job --create myjob \
--import \
--connect jdbc:mysql://ip-171-33-113-14:3306/sqooped  \
--username squser \
--password ABCD1234 \
--table sac01  \
--m 1

ERROR info

17/05/04 08:59:49 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6.2.3.4.0-3485
17/05/04 08:59:49 ERROR tool.BaseSqoopTool: Error parsing arguments for job:
17/05/04 08:59:49 ERROR tool.BaseSqoopTool: Unrecognized argument: --import
17/05/04 08:59:49 ERROR tool.BaseSqoopTool: Unrecognized argument: --connect
17/05/04 08:59:49 ERROR tool.BaseSqoopTool: Unrecognized argument: jdbc:mysql://ip-171-33-113-14:3306/sqooped  
17/05/04 08:59:49 ERROR tool.BaseSqoopTool: Unrecognized argument: --username
17/05/04 08:59:49 ERROR tool.BaseSqoopTool: Unrecognized argument: squser 
17/05/04 08:59:49 ERROR tool.BaseSqoopTool: Unrecognized argument: --password
17/05/04 08:59:49 ERROR tool.BaseSqoopTool: Unrecognized argument: ABCD1234 
17/05/04 08:59:49 ERROR tool.BaseSqoopTool: Unrecognized argument: --table
17/05/04 08:59:49 ERROR tool.BaseSqoopTool: Unrecognized argument: sac01
17/05/04 08:59:49 ERROR tool.BaseSqoopTool: Unrecognized argument: --m
17/05/04 08:59:49 ERROR tool.BaseSqoopTool: Unrecognized argument: 1

Solution

  • Sqoop job syntax:

    sqoop job (generic-args) (job-args) [-- [subtool-name] (subtool-args)]
    

    So, there should be space between -- and import in your command.

    Try this:

    sqoop job --create myjob \
    -- import \
    --connect jdbc:mysql://ip-171-33-113-14:3306/sqooped  \
    --username squser \
    --password ABCD1234 \
    --table sac01  \
    --m 1