0
votes

I am getting error for sqoop action in oozie workflow. When I run the same sqoop command from unix propmt to test it works, but in oozie it fails

Logs..

Sqoop command arguments : import --connect "jdbc:sqlserver://xxxx:1433;databaseName=INS;username=xxx;password=xxx" --query "select * from dbo.tu4h3 WHERE CONCAT(substring(convert (CHAR(20),TIMESTAMP_UPDATED,120),1,10),substring(convert (CHAR(20),TIMESTAMP_UPDATED,120),12,19)) >= 'date "+%Y-%m-%d%T" -d "1 days ago"' and $CONDITIONS" -m 8 --target-dir hdfs://csaa-aap-qa/user/xgkg5red/tu4h3/2015-08-17 --fields-terminated-by \001 --compression-codec snappy --split-by TIMESTAMP_UPDATED --map-column-java TIMESTAMP_UPDATED=String; Launch time = 1439879702947

Job launch time = 1439879702947 mapreduce.job.tags = oozie-1759ebad3e0fed00730556361c9eb485

Invoking Sqoop command line now >>>

1867 [main] WARN org.apache.sqoop.tool.SqoopTool - $SQOOP_CONF_DIR has not been set in the environment. Cannot check for additional configuration. 1900 [main] INFO org.apache.sqoop.Sqoop - Running Sqoop version: 1.4.4.2.1.5.0-695 1918 [main] WARN org.apache.sqoop.ConnFactory - $SQOOP_CONF_DIR has not been set in the environment. Cannot check for additional configuration. 1940 [main] INFO org.apache.sqoop.manager.SqlManager - Using default fetchSize of 1000 1940 [main] INFO org.apache.sqoop.tool.CodeGenTool - Beginning code generation 2230 [main] INFO org.apache.sqoop.manager.SqlManager - Executing SQL statement: select * from dbo.tu4h3 WHERE CONCAT(substring(convert (CHAR(20),TIMESTAMP_UPDATED,120),1,10),substring(convert (CHAR(20),TIMESTAMP_UPDATED,120),12,19)) >= 'date "+%Y-%m-%d%T" -d "1 days ago"' and (1 = 0) 2323 [main] INFO org.apache.sqoop.manager.SqlManager - Executing SQL statement: select * from dbo.tu4h3 WHERE CONCAT(substring(convert (CHAR(20),TIMESTAMP_UPDATED,120),1,10),substring(convert (CHAR(20),TIMESTAMP_UPDATED,120),12,19)) >= 'date "+%Y-%m-%d%T" -d "1 days ago"' and (1 = 0) 2339 [main] ERROR org.apache.sqoop.orm.ClassWriter - No ResultSet method for Java type String; 2340 [main] ERROR org.apache.sqoop.tool.ImportTool - Imported Failed: No ResultSet method for Java type String; Intercepting System.exit(1)

<<< Invocation of Main class completed <<<

Failing Oozie Launcher, Main class [org.apache.oozie.action.hadoop.SqoopMain], exit code [1]

Oozie Launcher failed, finishing Hadoop job gracefully

Oozie Launcher, uploading action data to HDFS sequence file: hdfs://csaa-aap-qa/user/hdfs/oozie-oozi/0000910-150729052958048-oozie-oozi-W/create-sqoop--sqoop/action-data.seq

Oozie Launcher ends

1

1 Answers

0
votes

The issue has nothing to do with Sqoop or with Java.

Your Sqoop arguments contain a dynamic parameter that is expressed as a bash script snippet, using date. So it works when you run it in a Linux console.

But Oozie is not a Linux console, it's a Java application. The "date" stuff is handled as a string litteral. That's why it shows as-is in the error message - something that you should have noticed.

If you are interested in dynamic date parameters in Oozie, have a look at this post.