Sqoop导出错误

问题描述 投票:1回答:3

我使用Sqoop 1.4.4将数据从hdfs导出到mysql。并得到以下错误:

bin/sqoop export --connect jdbc:mysql://127.0.0.1:3306/rec --username root --password root --table rec_temp --export-dir hdfs://127.0.0.1:9000//user/hdfs/part-r-00000 input-lines-terminated-by ' '    

14/12/20 17:14:04 INFO manager.MySQLManager: Preparing to use a MySQL streaming resultset.
14/12/20 17:14:04 INFO tool.CodeGenTool: Beginning code generation
14/12/20 17:14:05 INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM `rec_temp` AS t LIMIT 1
14/12/20 17:14:05 ERROR manager.SqlManager: Error reading from database: java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic@76b03b7f 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@76b03b7f 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.

更多信息:

part-r-00000 data:
1   [105:1.1617604]
.....

mysql> describe rec_temp;
+-----------+---------+------+-----+---------+-------+
| Field     | Type    | Null | Key | Default | Extra |
+-----------+---------+------+-----+---------+-------+
| user_id   | int(11) | NO   | PRI | NULL    |       |
| rec_value | text    | YES  |     | NULL    |       |
+-----------+---------+------+-----+---------+-------+

你能帮我解决这个问题吗?谢谢!

mysql hdfs sqoop
3个回答
2
投票

在sqoop报告的here中有一个类似的错误。请验证您正在使用的正确的MySQL连接器版本和sqoop版本,并根据需要更新版本。希望这将解决您的问题。谢谢。


0
投票

尝试使用另一个mysql驱动程序版本,如@Sachin所说。

它没有使用sqoop-1.6.1 + mysql-connector-java-5.0.8.tar工作,但当我改为mysql-connector-java-5.1.17.jar时工作正常


0
投票

添加--driver com.mysql.jdbc.Driver --direct例如,这对我有用:

sqoop export --connect jdbc:mysql://sandbox.hortonworks.com:3306/retail_db --username retail_dba --password hadoop --driver com.mysql.jdbc.Driver --direct --export-dir /user/horton/weather --table weather
© www.soinside.com 2019 - 2024. All rights reserved.