How to handle the Oracle ANYDATA type when using the tSqoopImport component

Talend Version (Required)       6.3.1 and prior

Summary

How to handle the Oracle ANYDATA type when using the tSqoopImport component.
Additional Versions  
Product (Required) Talend Big Data
Component (Required) Studio
Problem Description

A Job failed with the following error when processing an Oracle ANYDATA type through the tSqoopImport component.

[ERROR]: org.apache.sqoop.Sqoop - Got exception running Sqoop: java.lang.NullPointerException
[FATAL]: localproject631.testsqoop_javaapi_0_1.testSqoop_javaAPI - tSqoopImport_1 The Sqoop import job has failed. Please check the logs.
[statistics] disconnected
java.lang.NullPointerException
	at org.apache.sqoop.orm.ClassWriter.parseNullVal(ClassWriter.java:1378)
	at org.apache.sqoop.orm.ClassWriter.parseColumn(ClassWriter.java:1403)
	at org.apache.sqoop.orm.ClassWriter.myGenerateParser(ClassWriter.java:1529)
	at org.apache.sqoop.orm.ClassWriter.generateParser(ClassWriter.java:1492)
	at org.apache.sqoop.orm.ClassWriter.generateClassForColumns(ClassWriter.java:1929)
	at org.apache.sqoop.orm.ClassWriter.generate(ClassWriter.java:1737)
	at org.apache.sqoop.tool.CodeGenTool.generateORM(CodeGenTool.java:107)
	at org.apache.sqoop.tool.ImportTool.importTable(ImportTool.java:478)
	at org.apache.sqoop.tool.ImportTool.run(ImportTool.java:605)
	at org.apache.sqoop.Sqoop.run(Sqoop.java:143)
	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
	at org.apache.sqoop.Sqoop.runSqoop(Sqoop.java:179)
	at localproject631.testsqoop_javaapi_0_1.testSqoop_javaAPI.tSqoopImport_1Process(testSqoop_javaAPI.java:690)
	at localproject631.testsqoop_javaapi_0_1.testSqoop_javaAPI.tHDFSConnection_1Process(testSqoop_javaAPI.java:420)
	at localproject631.testsqoop_javaapi_0_1.testSqoop_javaAPI.runJobInTOS(testSqoop_javaAPI.java:1027)
	at localproject631.testsqoop_javaapi_0_1.testSqoop_javaAPI.main(testSqoop_javaAPI.java:867)
Problem root cause  
Solution or Workaround

Sqoop Commandline mode

From the Advanced settings of the tSqoopImport component, select Define Java Mapping and add a Java mapping for the ANYDATA type.

  • Column name: [ANYDATA field]

  • Java type: String

 

Java API mode

From the Advanced settings of the tSqoopImport component, specify the Java mapping in the Additional Arguments table.

  • Argument: map.column.java.[ANYDATA field]
  • Value: String
JIRA ticket number  
Version history
Revision #:
4 of 4
Last update:
‎11-01-2017 03:50 PM
Updated by:
 
Labels (3)