当前位置:首页 > 服务端 > Sqoop异常Encountered IOException running export job: java.io.IOException: No columns to generate for ClassWriter解决

Sqoop异常Encountered IOException running export job: java.io.IOException: No columns to generate for ClassWriter解决


如果在使用Sqoop将Hive中的数据导出到mysql的时候报如下错误:
[yao.meng@h1 ~]$ sqoop export --connect "jdbc:mysql://192.168.14.71:3306/rtcrawler?useUnicode=true&characterEncoding=utf8" --username root --password root --table rtc_nuomi --export-dir /rtcrawler/nuomi/data --input-fields-terminated-by '\t' --input-null-string 'null' --input-null-non-string 'null'
Warning: /usr/local/hbase does not exist! HBase imports will fail.
Please set $HBASE_HOME to the root of your HBase installation.
Warning: /usr/local/accumulo does not exist! Accumulo imports will fail.
Please set $ACCUMULO_HOME to the root of your Accumulo installation.
16/01/06 15:07:24 INFO sqoop.Sqoop: Running Sqoop version: 1.4.6
16/01/06 15:07:24 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
16/01/06 15:07:24 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
16/01/06 15:07:24 INFO tool.CodeGenTool: Beginning code generation
16/01/06 15:07:24 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `users` AS t LIMIT 1
16/01/06 15:07:24 ERROR manager.SqlManager: Error reading from database: java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic@1b9ced28 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@1b9ced28 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:934)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:931)
    at com.mysql.jdbc.MysqlIO.checkForOutstandingStreamingData(MysqlIO.java:2735)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1899)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2619)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2569)
    at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1524)
    at com.mysql.jdbc.ConnectionImpl.getMaxBytesPerChar(ConnectionImpl.java:3003)
    at com.mysql.jdbc.Field.getMaxBytesPerCharacter(Field.java:602)
    at com.mysql.jdbc.ResultSetMetaData.getPrecision(ResultSetMetaData.java:445)
    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:1845)
    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.ExportTool.exportTable(ExportTool.java:64)
    at org.apache.sqoop.tool.ExportTool.run(ExportTool.java:100)
    at org.apache.sqoop.Sqoop.run(Sqoop.java:148)
    at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
    at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:184)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:226)
    at org.apache.sqoop.Sqoop.runTool(Sqoop.java:235)
    at org.apache.sqoop.Sqoop.main(Sqoop.java:244)
16/01/06 15:07:24 ERROR tool.ExportTool: Encountered IOException running export job: java.io.IOException: No columns to generate for ClassWriter

这个错误是较老的mysql-connect-java.jar的bug导致,替换Sqoop/lib/下的mysql驱动包为mysql-connect-java-5.1.35.jar即可。

 

作者:孟尧
来源链接:https://www.cnblogs.com/mengyao/archive/2013/05/07/5106739.html

版权声明:
1、Java侠(https://www.javaxia.com)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。

2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。





本文链接:https://www.javaxia.com/server/124728.html

标签: IOException
分享给朋友:

“Sqoop异常Encountered IOException running export job: java.io.IOException: No columns to generate for ClassWriter解决” 的相关文章