Sqoop1 Import Job Failed With Error “java.io.IOException: No columns to generate for ClassWriter”

Recently when I was testing Sqoop1 command in my CDH cluster, I kept getting “java.io.IOException: No columns to generate for ClassWriter” error. The full command was like below: sqoop import –connect jdbc:mysql://<mysql-host>/test –table test –username <username> –password <password> –target-dir sqoop_test -m 1 And full stacktrace: 16/08/20 03:03:13 ERROR manager.SqlManager: Error …

Sqoop Hive Import Failed After Upgrading to CDH5.4.x or CDH5.5.x

This article explains the root cause of Sqoop Hive Import failure after upgrading to CDH5.4.x or CDh5.5.x and the solution to fix the issue. After upgrading to CDH5.5.x from CDh5.3.x, Sqoop Hive Import got the following error: 16/01/12 18:27:25 WARN hive.TableDefWriter: Column EXPIRN_TS had to be cast to a less …

Unable to import Oracle table with CLOB column into HDFS using Sqoop

If you encountered the following error while importing Oracle table into HDFS: org.apache.sqoop.mapreduce.TextExportMapper: Exception: java.io.IOException: Could not buffer record at org.apache.sqoop.mapreduce.AsyncSqlRecordWriter.write(AsyncSqlRecordWriter.java:218) at org.apache.sqoop.mapreduce.AsyncSqlRecordWriter.write(AsyncSqlRecordWriter.java:46) at org.apache.hadoop.mapred.MapTask$NewDirectOutputCollector.write(MapTask.java:655) at org.apache.hadoop.mapreduce.task.TaskInputOutputContextImpl.write(TaskInputOutputContextImpl.java:89) at org.apache.hadoop.mapreduce.lib.map.WrappedMapper$Context.write(WrappedMapper.java:112) at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:84) at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:39) at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145) at org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:64) at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:784) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:341) at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:422) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1642) …

Sqoop Action with –query fails on oozie using tag

Yesterday I have discovered an Oozie bug that it does not handle the –query parameter for sqoop action. See my example sqoop action XML below: <action name="sqoop-ed7d" cred="hive2"> <sqoop xmlns="uri:oozie:sqoop-action:0.2"> <job-tracker>${jobTracker}</job-tracker> <name-node>${nameNode}</name-node> <prepare> <delete path="${nameNode}/user/eric/sqoop-import"> </delete></prepare> <command></command>import –connect jdbc:mysql://node6.lab.cloudera.com/test –username root –password cloudera –target-dir hdfs://node5.lab.cloudera.com:8020/user/eric/sqoop-import –query "SELECT * FROM test …