Search code examples
hivesqoop

ERROR orm.ClassWriter: No Java type for SQL type -8 for column AAA$T


I have a view in oracle db, in the view one column is ROWID column, Once I try to import the load into sqoop it throws following error:

.
.
.
    17/09/14 08:15:32 INFO manager.OracleManager: Time zone has been set to GMT
17/09/14 08:15:32 INFO manager.SqlManager: Executing SQL statement: select * from user1.table1 where  (1 = 0) 
17/09/14 08:15:32 INFO manager.SqlManager: Executing SQL statement: select * from user1.table1 where  (1 = 0) 
17/09/14 08:15:32 INFO manager.SqlManager: Executing SQL statement: select * from user1.table1 where  (1 = 0) 
17/09/14 08:15:32 ERROR orm.ClassWriter: Cannot resolve SQL type -8
17/09/14 08:15:32 ERROR orm.ClassWriter: Cannot resolve SQL type -8
17/09/14 08:15:32 ERROR orm.ClassWriter: Cannot resolve SQL type -8
17/09/14 08:15:32 ERROR orm.ClassWriter: Cannot resolve SQL type -8
17/09/14 08:15:32 ERROR orm.ClassWriter: No Java type for SQL type -8 for column AAA$col
17/09/14 08:15:32 ERROR orm.ClassWriter: No Java type for SQL type -8 for column AAA$col
17/09/14 08:15:32 ERROR orm.ClassWriter: No Java type for SQL type -8 for column AAA$col
17/09/14 08:15:32 ERROR orm.ClassWriter: No Java type for SQL type -8 for column AAA$col
17/09/14 08:15:32 ERROR orm.ClassWriter: No Java type for SQL type -8 for column AAA$col
17/09/14 08:15:32 ERROR orm.ClassWriter: No Java type for SQL type -8 for column AAA$col
17/09/14 08:15:32 ERROR orm.ClassWriter: No Java type for SQL type -8 for column AAA$col
17/09/14 08:15:32 ERROR orm.ClassWriter: No Java type for SQL type -8 for column AAA$col
17/09/14 08:15:32 ERROR orm.ClassWriter: No Java type for SQL type -8 for column AAA$col
17/09/14 08:15:32 ERROR orm.ClassWriter: No Java type for SQL type -8 for column AAA$col
17/09/14 08:15:32 ERROR orm.ClassWriter: No Java type for SQL type -8 for column AAA$col
17/09/14 08:15:32 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.NullPointerException
java.lang.NullPointerException
at org.apache.sqoop.orm.ClassWriter.parseNullVal(ClassWriter.java:1389)
.
.
.

The command I am using to import the data:

sqoop import --connect "jdbc:oracle:thin:@172.20.50.111:1521/abc" \
--username user1 \
--password "passes" \
--query 'select * from user1.table1 where $CONDITIONS' \
--hive-import \
--create-hive-table \
--hive-table sv.table1 \
--map-column-hive 'AAA$col'=STRING \
--target-dir "/home/table1" \
--m 1

I understand that ROWID can not be imported directly, so I am using --map-column-hive option. What else I can try ?

Please help.


Solution

  • Java mapping is also required to create POJO.

    Add --map-column-java 'AAA$col'=String