Support Questions

Find answers, ask questions, and share your expertise

sqoop import hive table error

avatar
Expert Contributor

In HDP Sandbox 2.6.4 I imported mysql to hdfs but when I tried to import from mysql to hive with the following command:

[maria_dev@sandbox-hdp ~]$ sqoop import --connect jdbc:mysql://sandbox-hdp.hortonworks.com/azhadoop --username root --password hadoop --query 'select * from iris_mysql WHERE $CONDITIONS' --m 1 --hive-import --hive-table azhadoop.iris_hive --target-dir /tmp/hive_temp

But I got this error:

19/04/27 14:22:19 ERROR manager.SqlManager: Error reading from database: java.sql.SQLException: Streaming result set com.mysql.jdbc.RowDataDynamic@4b8ee4de 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@4b8ee4de 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.
1 ACCEPTED SOLUTION

avatar
Master Mentor

@Erkan ŞİRİN

Nice to know it worked just wondering didn't see --create-hive-table statement? can you try adding like below

--hive-table azhadoop.iris_hive \
--create-hive-table \
--target-dir /tmp/hive_temp

Please let me know

View solution in original post

10 REPLIES 10

avatar
Expert Contributor

Thank you very much @Geoffrey Shelton Okot it worked.