sqoop到mysql导入问题

时间:2015-08-24 07:43:20

标签: mysql hive sqoop

我使用以下命令将数据从mysql表提取到配置单元表:

sqoop import \
--connect jdbc:mysql://xx.xx.xx.xx/orderdbms \
--username=orderuser \
--password=orderpass \
--table=order \
--where="DATE(created)='2015-08-20'" \
--hive-import \
--hive-table=orderstat.order \
--target-dir=/user/ordermanager/sqoopdata/orders \
--direct

执行上述操作时出现以下错误:

  

从数据库读取时出错:java.sql.SQLException:流式传输结果   set com.mysql.jdbc.RowDataDynamic@1f16ebd3仍处于活动状态。没有   当任何流式传输结果集打开时,可以发出语句   在给定连接上使用。确保已调用.close()   尝试更多查询之前的任何活动流结果集。   java.sql.SQLException:流结果集   com.mysql.jdbc.RowDataDynamic@1f16ebd3仍处于活动状态。没有陈述   可以在任何流式传输结果集打开并在a上使用时发布   给定连接。确保您已在任何活动状态上调用.close()   在尝试更多查询之前传输结果集。在   com.mysql.jdbc.SQLError.createSQLException(SQLError.java:914)at at   com.mysql.jdbc.MysqlIO.checkForOutstandingStreamingData(MysqlIO.java:2181)     在com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1542)at   com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)at at   com.mysql.jdbc.Connection.execSQL(Connection.java:3277)at   com.mysql.jdbc.Connection.execSQL(Connection.java:3206)at   com.mysql.jdbc.Statement.executeQuery(Statement.java:1232)at   com.mysql.jdbc.Connection.getMaxBytesPerChar(Connection.java:3673)at at   com.mysql.jdbc.Field.getMaxBytesPerCharacter(Field.java:482)at at   com.mysql.jdbc.ResultSetMetaData.getPrecision(ResultSetMetaData.java:443)     在   org.apache.sqoop.manager.SqlManager.getColumnInfoForRawQuery(SqlManager.java:286)     在   org.apache.sqoop.manager.SqlManager.getColumnTypesForRawQuery(SqlManager.java:241)     在   org.apache.sqoop.manager.SqlManager.getColumnTypes(SqlManager.java:227)     在   org.apache.sqoop.manager.ConnManager.getColumnTypes(ConnManager.java:295)     在   org.apache.sqoop.orm.ClassWriter.getColumnTypes(ClassWriter.java:1833)     在org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1645)     在   org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)     在org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)     在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 at   org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)at at   org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)at at   org.apache.sqoop.Sqoop.main(Sqoop.java:236)15/08/24 11:54:46错误   tool.ImportTool:遇到运行导入作业的IOException:   java.io.IOException:没有为ClassWriter生成的列   org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1651)at at   org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)     在org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)     在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 at   org.apache.sqoop.Sqoop.runTool(Sqoop.java:218)at at   org.apache.sqoop.Sqoop.runTool(Sqoop.java:227)at at   org.apache.sqoop.Sqoop.main(Sqoop.java:236)

任何人都可以解释导致这种情况的原因吗?客户端和客户端之间的语法或连接问题是否存在问题? mysql服务器。

1 个答案:

答案 0 :(得分:0)

尝试添加选项

--driver com.mysql.jdbc.Driver