Created 05-06-2016 05:43 AM
I am trying to run a sqoop command through oozie and it says :
Unrecognized argument: --target-dir
in oozie launcher logs.
This is what my command looks like:
import-all-tables --driver com.mysql.jdbc.Driver --connect jdbc:mysql://warehouse.swtched.com/erp --username hive --password hive -m 1 --target-dir sblDW
The target-dir attribute works just fine when I am running in through command line. How do I fix this?
error:
>>> Invoking Sqoop command line now >>> 2893 [main] WARN org.apache.sqoop.tool.SqoopTool - $SQOOP_CONF_DIR has not been set in the environment. Cannot check for additional configuration. 2016-05-06 11:11:34,741 WARN [main] tool.SqoopTool (SqoopTool.java:loadPluginsFromConfDir(177)) - $SQOOP_CONF_DIR has not been set in the environment. Cannot check for additional configuration. 2941 [main] INFO org.apache.sqoop.Sqoop - Running Sqoop version: 1.4.6.2.4.0.0-169 2016-05-06 11:11:34,789 INFO [main] sqoop.Sqoop (Sqoop.java:<init>(97)) - Running Sqoop version: 1.4.6.2.4.0.0-169 2965 [main] WARN org.apache.sqoop.tool.BaseSqoopTool - Setting your password on the command-line is insecure. Consider using -P instead. 2016-05-06 11:11:34,813 WARN [main] tool.BaseSqoopTool (BaseSqoopTool.java:applyCredentialsOptions(1026)) - Setting your password on the command-line is insecure. Consider using -P instead. 2967 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool - Error parsing arguments for import-all-tables: 2016-05-06 11:11:34,815 ERROR [main] tool.BaseSqoopTool (BaseSqoopTool.java:hasUnrecognizedArgs(304)) - Error parsing arguments for import-all-tables: 2967 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool - Unrecognized argument: --target-dir 2016-05-06 11:11:34,815 ERROR [main] tool.BaseSqoopTool (BaseSqoopTool.java:hasUnrecognizedArgs(307)) - Unrecognized argument: --target-dir 2967 [main] ERROR org.apache.sqoop.tool.BaseSqoopTool - Unrecognized argument: sblDW 2016-05-06 11:11:34,815 ERROR [main] tool.BaseSqoopTool (BaseSqoopTool.java:hasUnrecognizedArgs(307)) - Unrecognized argument: sblDW Intercepting System.exit(1)
Created 05-06-2016 06:24 AM
Try replacing --target-dir with --warehouse-dir. Table t1 will be imported into directory warehouse-dir/t1. Regarding Hive, add --hive-import, the very first time use --create-hive-table, and after that use --hive-overwrite. If troubles continue, test your Oozie Sqoop action on a single table import into hdfs, just to make sure you have the right syntax. After that retry import-all-tables.
Created 05-06-2016 05:47 AM
Please pass arguments in <arg> </arg> tag.
Please refer - http://alvincjin.blogspot.in/2014/06/create-sqoop-action-in-oozie-using-hue.html
Created 05-06-2016 05:57 AM
@Kuldeep Kulkarni : Are you sure that --target-dir works with import-all-tables?
As this link says, it does not.
Also, what should be the command to import all tables in hive without having to create the tables first in hive?
https://groups.google.com/forum/#!msg/chennaihug/hWAKeO9Lnh0/y7RBYtti6AgJ
Created 05-06-2016 06:13 AM
@simran kaur - As per your comment "The target-dir attribute works just fine when I am running in through command line. How do I fix this?"
If it is working via command line then it should work via oozie.
Created 05-06-2016 06:22 AM
@Kuldeep KulkarniOh, I forgot to mention that it was only single table import that i had tried through command line. Also, could you please clarify how do I import all tables in a particular directory?
Created 05-06-2016 06:24 AM
Try replacing --target-dir with --warehouse-dir. Table t1 will be imported into directory warehouse-dir/t1. Regarding Hive, add --hive-import, the very first time use --create-hive-table, and after that use --hive-overwrite. If troubles continue, test your Oozie Sqoop action on a single table import into hdfs, just to make sure you have the right syntax. After that retry import-all-tables.