Sqoop 导入数据报错:No columns to generate for ClassWriter

使用Sqoop 导入数据报错信息如下:

java.sql.SQLException: Streaming result set com.mysql.jdbc
18/09/07 10:09:20 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
18/09/07 10:09:20 INFO tool.CodeGenTool: Beginning code generation
18/09/07 10:09:20 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `EMP` AS t LIMIT 1
18/09/07 10:09:20 ERROR manager.SqlManager: Error reading from database: java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic@13c10b87 is still active. No statements may be issued when any streaming result sets are open and in use on a given connection. Ensure that you have called .close() on any active streaming result sets before attempting more queries.
java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic@13c10b87 is still active. No statements may be issued when any streaming result sets are open and in use on a given connection. Ensure that you have called .close() on any active streaming result sets before attempting more queries.
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:930)
	at com.mysql.jdbc.MysqlIO.checkForOutstandingStreamingData(MysqlIO.java:2622)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1846)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2536)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2465)
	at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1383)
	at com.mysql.jdbc.ConnectionImpl.getMaxBytesPerChar(ConnectionImpl.java:2931)
	at com.mysql.jdbc.Field.getMaxBytesPerCharacter(Field.java:582)
	at com.mysql.jdbc.ResultSetMetaData.getPrecision(ResultSetMetaData.java:441)
	at org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:286)
	at org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:241)
	at org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:227)
	at org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:295)
	at org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1833)
	at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1645)
	at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)
	at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)
	at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)
	at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
	at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
	at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
	at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
	at org.apache.sqoop.Sqoop.main(Sqoop.java:236)
18/09/07 10:09:21 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:1651)
	at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)
	at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)
	at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)
	at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
	at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
	at org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)
	at org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)
	at org.apache.sqoop.Sqoop.main(Sqoop.java:236)

Sqoop 导入数据报错:No columns to generate for ClassWriter_第1张图片

解决方案: 

mysql的jar导致,由于我用的是mysql-connector-java-5.1.6-bin.jar,更新成mysql-connector-java-5.1.40-bin.jar即可。

Sqoop 导入数据报错:No columns to generate for ClassWriter_第2张图片

Sqoop 导入数据报错:No columns to generate for ClassWriter_第3张图片

再次导入 

Sqoop 导入数据报错:No columns to generate for ClassWriter_第4张图片 

Sqoop 导入数据报错:No columns to generate for ClassWriter_第5张图片 

Sqoop 导入数据报错:No columns to generate for ClassWriter_第6张图片 

完成查看数据

Sqoop 导入数据报错:No columns to generate for ClassWriter_第7张图片 

Sqoop 导入数据报错:No columns to generate for ClassWriter_第8张图片 

 

你可能感兴趣的:(Sqoop,No,columns,to,generate,for,Cla)