Sqoop export using input-null-string and input-null-non-string-Error

Hi Durga Sir,

I am using the sqoop export using input-null-string and input-null-non-string ,

sqoop export –connect 
“jdbc:mysql://quickstart.clouera:3306/retail_db” –username retail_dba 
–password cloudera –table departments_test –export-dir 
/user/hive/warehouse/departments_test –input-fields-terminated-by ‘\001’
 –input-lines-terminated-by ‘\n’  –num-mappers 2 –batch  –outdir 
java_files –input-null-string nvl –input-null-non-string -1

I am getting an error … I have pasted the last 3 lines .

	at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:213)

	at com.mysql.jdbc.MysqlIO.(MysqlIO.java:297)

	… 33 more

16/11/27 19:44:02 ERROR tool.ExportTool: Encountered IOException running
 export job: java.io.IOException: No columns to generate for ClassWriter

Could you pleas help me resolve this issue . Did i missed anything here.

Errors are logged in the form of stack. You have to paste the error displayed at the beginning.

There’s also a typo error:

jdbc:mysql://quickstart.clouera:3306/retail_db”

‘d’ is missing in cloudera not sure if this is the cause but lets try.

1 Like

I’m also facing same issue…

My Export query:
sqoop export --connect “jdbc:mysql://nn01.itversity.com/retail_export” --username retail_dba --password itversity --table sg_departments_null_export --export-dir /user/selva2389/sqoop_export/department_null --input-null-string ‘\n’ --input-null-non-string -1

Error :
Error: java.io.IOException: Can’t export data, please check failed map task logs at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:122) at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:39) at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:146) at org.apache.sqoop.mapreduce.AutoProgressMapper.run(AutoProgressMapper.java:64) at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:787) 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:1724) at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:162) Caused by: java.lang.RuntimeException: Can’t parse input data: ‘null’ at sg_departments_null_export.__loadFromFields(sg_departments_null_export.java:365) at sg_departments_null_export.parse(sg_departments_null_export.java:298) at org.apache.sqoop.mapreduce.TextExportMapper.map(TextExportMapper.java:89) … 10 more Caused by: java.lang.NumberFormatException: For input string: “null” at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:580) at java.lang.Integer.valueOf(Integer.java:766) at sg_departments_null_export.__loadFromFields(sg_departments_null_export.java:357) … 12 more

Any idea ?