sqoop import command can't handle Oracle ANYDATA type


If a table contains a column which is ANYDATA type (for example, column V_CL1), then executing the sqoop import command in sqoop would fail with the following error:


[ERROR]: org.apache.sqoop.orm.ClassWriter - Cannot resolve SQL type 2007
[ERROR]: org.apache.sqoop.orm.ClassWriter - No Java type for SQL type 2007 for column V_CL1



Add --map-column-java V_CL1=String to the command, for example:


sqoop import --connect 'jdbc:oracle:thin:@[ip]:[port]:[schema]' --username username --password password --query 'SELECT V_CL1 FROM db1 WHERE $CONDITIONS' --map-column-java V_CL1=String -m 1 --target-dir /user/cloudera/test
Version history
Revision #:
7 of 7
Last update:
‎09-29-2018 12:10 AM
Updated by: