Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Sqoop SQL Syntax Error Near "," when importing SAP HANA view

Highlighted

Sqoop SQL Syntax Error Near "," when importing SAP HANA view

Contributor

This is my script:

sqoop --options-file sqoop-opt.txt --table HDFS_MATERIAL_MASTER --hive-import --hive-overwrite --hive-database SAP

This is the error I get:

Error: java.io.IOException: SQLException in nextKeyValue at org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:277) at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:556) at org.apache.hadoop.mapreduce.task.MapContextImpl.nextKeyValue(MapContextImpl.java:80) at org.apache.hadoop.mapreduce.lib.map.WrappedMapper$Context.nextKeyValue(WrappedMapper.java:91) at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145) at org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:64) at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:787) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341) at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:164) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657) at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158) Caused by: com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [257]: sql syntax error: incorrect syntax near ",": line 1 col 479 (at pos 479) at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.createException(SQLExceptionSapDB.java:345) at com.sap.db.jdbc.exceptions.SQLExceptionSapDB.generateDatabaseException(SQLExceptionSapDB.java:185) at com.sap.db.jdbc.packet.ReplyPacket.buildExceptionChain(ReplyPacket.java:100) at com.sap.db.jdbc.ConnectionSapDB.execute(ConnectionSapDB.java:1130) at com.sap.db.jdbc.CallableStatementSapDB.sendCommand(CallableStatementSapDB.java:1810) at com.sap.db.jdbc.StatementSapDB.sendSQL(StatementSapDB.java:981) at com.sap.db.jdbc.CallableStatementSapDB.doParse(CallableStatementSapDB.java:183) at com.sap.db.jdbc.CallableStatementSapDB.constructor(CallableStatementSapDB.java:142) at com.sap.db.jdbc.CallableStatementSapDB.<init>(CallableStatementSapDB.java:87) at com.sap.db.jdbc.CallableStatementSapDBFinalize.<init>(CallableStatementSapDBFinalize.java:31) at com.sap.db.jdbc.ConnectionSapDB.prepareStatement(ConnectionSapDB.java:1379) at com.sap.db.jdbc.trace.Connection.prepareStatement(Connection.java:347) at org.apache.sqoop.mapreduce.db.DBRecordReader.executeQuery(DBRecordReader.java:101) at org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:235) ... 12 more

3 REPLIES 3
Highlighted

Re: Sqoop SQL Syntax Error Near "," when importing SAP HANA view

When we use -(dash) to sqoop command it becomes a parameter to sqoop command therefore please rename your option file from sqoop-opt.txt to sqoop_opt.txt so that it identified the file name properly.

Highlighted

Re: Sqoop SQL Syntax Error Near "," when importing SAP HANA view

Contributor

I don't think that's the problem, I've used the same options file to import many other tables with no errors...

Highlighted

Re: Sqoop SQL Syntax Error Near "," when importing SAP HANA view

Rising Star

Check if your SQL syntax might either be missing a comma or have an extra comma after one of the field values.

Don't have an account?
Coming from Hortonworks? Activate your account here