Support Questions
Find answers, ask questions, and share your expertise

sqoop export command to export data from hdfs to sqlserver

sqoop export command to export data from hdfs to sqlserver

Expert Contributor

hello,

i have HDInsight servie on azure. i have stored the hive query output in csv file on hdfs. i want to export this csv file to the sql server table.

i used the following command:

sqoop export -m 1 --connect jdbc:sqlserver://hdpserver.database.windows.net/Hadoopdb --username aaa --password aaaa --table dbo.test --direct --export-dir /1test/data/ --driver com.microsoft.sqlserver.jdbc.SQLServerDriver

but i am getting following error:

ERROR tool.ExportTool: Encountered IOException running export job: java.io.IOException: No columns to generate for ClassWriter

5 REPLIES 5

Re: sqoop export command to export data from hdfs to sqlserver

Guru

Re: sqoop export command to export data from hdfs to sqlserver

Explorer

What is dbo? Is that database or just fully table name?

Re: sqoop export command to export data from hdfs to sqlserver

Expert Contributor

dbo is schema and test is table

Re: sqoop export command to export data from hdfs to sqlserver

Explorer

I think --table value should be only tableName like 'test'.

Dabatase is already defined in --connect jdbc........./Hadoopdb

So you can execute sqoop export, then connection like this 'Hadoopdb.test' or between Hadoopdb and dbo are different, then change connect database name '--connect jdbc........./dbo'

Re: sqoop export command to export data from hdfs to sqlserver

Explorer

Additionally, where is the --columns parameter? You just want to insert all data in test table?