0
votes

I've successfully imported a simple 2 column SQL Server data into HIVE using SQOOP on Cloudera CDH4.1. - id (int) - description (varchar(50))

When I try get the same HIVE table to go back to SQL Server it lumps the two columns together and therefore creates an NumberFormatException.

I've tried the --fields-terminated by \t --lines-terminated-by \n and this doesn't make any difference.

I've also tried to export the sample_08 Hive table as supplied by Cloudera but get a NoSuchElement exception. Wish it would give a clue as to which element it thinks doesn't exist!

I've ensured that the table structures and field names are both the same on both sides including the case and underscores.

I can export a single column table but am absolutely stumped as to how to resolve the issue.

Any help would be gratefully received.

1
I found that the Microsoft install of their SQOOP connector does not set up the configuration file in managers.d correctly. /usr/lib/sqoop/conf/managers.d/mssqoop-sqlserver should contain the path of the sqljdbc4.jar file but by default it omits it. The file should contain the following:- com.microsoft.sqoop.MSSQLServerManagerFactory/usr/lib/sqoop/lib/sqljdbc4.jar This simply gets me to the next error which is java.lang.NoSuchMethodErrorDave Poole

1 Answers

0
votes

Parameters --filds-terminated-by and --lines-terminated-by are used only during "import" operation. You need to use parameters --input-fields-terminated-by and --input-lines-terminated-by to do the same in "export" case.

Would you mind sharing entire exception stack trace and possibly example set of your data that trigger your issue?