Support Questions
Find answers, ask questions, and share your expertise

I am trying to import ibm db2 databases table data into HDFS and it's failing

New Contributor

$SQOOP_HOME/bin/sqoop import --connect jdbc:db2://he3qlxvddbs054:50001/WFTEST --username f402647 -P --table INV_G1 --target-dir /fmac/users/f402647 Warning: /usr/hdp/2.5.3.0-37/accumulo does not exist! Accumulo imports will fail. Please set $ACCUMULO_HOME to the root of your Accumulo installation. 17/04/27 12:32:55 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6.2.5.3.0-37 Enter password: 17/04/27 12:33:00 INFO manager.SqlManager: Using default fetchSize of 1000 17/04/27 12:33:00 INFO tool.CodeGenTool: Beginning code generation 17/04/27 12:33:00 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM INV_G1 AS t WHERE 1=0 17/04/27 12:33:00 ERROR manager.SqlManager: Error executing statement: com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=F402647.INV_G1, DRIVER=4.12.55 com.ibm.db2.jcc.am.SqlSyntaxErrorException: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704, SQLERRMC=F402647.INV_G1, DRIVER=4.12.55 at com.ibm.db2.jcc.am.hd.a(hd.java:676) at com.ibm.db2.jcc.am.hd.a(hd.java:60) at com.ibm.db2.jcc.am.hd.a(hd.java:127) at com.ibm.db2.jcc.am.mn.c(mn.java:2621) at com.ibm.db2.jcc.am.mn.d(mn.java:2609) at com.ibm.db2.jcc.am.mn.a(mn.java:2085) at com.ibm.db2.jcc.am.nn.a(nn.java:7054) at com.ibm.db2.jcc.t4.cb.g(cb.java:141) at com.ibm.db2.jcc.t4.cb.a(cb.java:41) at com.ibm.db2.jcc.t4.q.a(q.java:32) at com.ibm.db2.jcc.t4.rb.i(rb.java:135) at com.ibm.db2.jcc.am.mn.ib(mn.java:2055) at com.ibm.db2.jcc.am.nn.rc(nn.java:3219) at com.ibm.db2.jcc.am.nn.b(nn.java:4002) at com.ibm.db2.jcc.am.nn.ec(nn.java:728) at com.ibm.db2.jcc.am.nn.executeQuery(nn.java:698) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:777) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:786) at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:289) at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:260) at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:246) at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:328) at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1853) at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1653) at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107) at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:488) at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:615) at org.apache.sqoop.Sqoop.run(Sqoop.java:147) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:225) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234) at org.apache.sqoop.Sqoop.main(Sqoop.java:243) 17/04/27 12:33:00 ERROR manager.SqlManager: Chained exception 1: com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-727, SQLSTATE=56098, SQLERRMC=2;-204;42704;F402647.INV_G1, DRIVER=4.12.55 at com.ibm.db2.jcc.am.hd.a(hd.java:679) at com.ibm.db2.jcc.am.hd.a(hd.java:60) at com.ibm.db2.jcc.am.hd.a(hd.java:127) at com.ibm.db2.jcc.am.mn.c(mn.java:2621) at com.ibm.db2.jcc.am.mn.d(mn.java:2609) at com.ibm.db2.jcc.am.nn.a(nn.java:3115) at com.ibm.db2.jcc.t4.cb.a(cb.java:190) at com.ibm.db2.jcc.t4.cb.b(cb.java:84) at com.ibm.db2.jcc.t4.q.b(q.java:69) at com.ibm.db2.jcc.t4.sb.c(sb.java:244) at com.ibm.db2.jcc.am.nn.oc(nn.java:3106) at com.ibm.db2.jcc.am.nn.rc(nn.java:3220) at com.ibm.db2.jcc.am.nn.b(nn.java:4002) at com.ibm.db2.jcc.am.nn.ec(nn.java:728) at com.ibm.db2.jcc.am.nn.executeQuery(nn.java:698) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:777) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:786) at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:289) at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:260) at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:246) at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:328) at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1853) at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1653) at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107) at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:488) at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:615) at org.apache.sqoop.Sqoop.run(Sqoop.java:147) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:225) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234) at org.apache.sqoop.Sqoop.main(Sqoop.java:243) 17/04/27 12:33:00 ERROR manager.SqlManager: Chained exception 2: com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-727, SQLSTATE=56098, SQLERRMC=2;-204;42704;F402647.INV_G1, DRIVER=4.12.55 at com.ibm.db2.jcc.am.hd.a(hd.java:679) at com.ibm.db2.jcc.am.hd.a(hd.java:60) at com.ibm.db2.jcc.am.hd.a(hd.java:127) at com.ibm.db2.jcc.am.mn.c(mn.java:2621) at com.ibm.db2.jcc.am.mn.a(mn.java:2112) at com.ibm.db2.jcc.t4.cb.n(cb.java:845) at com.ibm.db2.jcc.t4.cb.i(cb.java:266) at com.ibm.db2.jcc.t4.cb.c(cb.java:55) at com.ibm.db2.jcc.t4.q.c(q.java:44) at com.ibm.db2.jcc.t4.rb.j(rb.java:147) at com.ibm.db2.jcc.am.mn.kb(mn.java:2107) at com.ibm.db2.jcc.am.nn.b(nn.java:4061) at com.ibm.db2.jcc.am.nn.ec(nn.java:728) at com.ibm.db2.jcc.am.nn.executeQuery(nn.java:698) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:777) at org.apache.sqoop.manager.SqlManager.execute(SqlManager.java:786) at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:289) at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:260) at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:246) at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:328) at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1853) at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1653) at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107) at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:488) at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:615) at org.apache.sqoop.Sqoop.run(Sqoop.java:147) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:225) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234) at org.apache.sqoop.Sqoop.main(Sqoop.java:243) 17/04/27 12:33:00 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: No columns to generate for ClassWriter at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1659) at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107) at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:488) at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:615) at org.apache.sqoop.Sqoop.run(Sqoop.java:147) at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:76) at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:183) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:225) at org.apache.sqoop.Sqoop.runTool(Sqoop.java:234) at org.apache.sqoop.Sqoop.main(Sqoop.java:243)

1 REPLY 1

Super Guru

@sudheer nadendla

Can you please verify INV_G1 exists? You probably need to qualify it with schema/db name. something like

SELECT * FROM <schema/db>.INV_G1 WHERE 1=0