Support Questions
Find answers, ask questions, and share your expertise

sqoop import for oracle 9i table returns empty data for VARCHAR2 type

New Contributor

we're using the below import command to import table's data from Oracle 9i database using "ojdbc6.jar". We get empty result although the original table contains data of the type VARCHAR2(10).

sqoop import --driver oracle.jdbc.driver.OracleDriver --connect \
"jdbc:oracle:thin:@IP_ADDRESS:PORT:SERVICE" --username "USER_NAME" \
 --password "PASSWORD" --target-dir "/sqoop_import/DATA/" --query \
'select SUBNO  from SCHEMA.TABLE where $CONDITIONS' --split-by\
 "TYPE_ID" --boundary-query 'select min(TYPE_ID),max(TYPE_ID) from\
 SCHEMA.TABLE' --map-column-java SUBNO=String

we have tried [with no use]:

  • hive import with and without --map-column-hive
  • --columns instead of specifying the query
  • using different ojdbc version
1 ACCEPTED SOLUTION

Accepted Solutions

@Mustafa El-badry

My recommendation is to downgrade the ojdbc with older version "ojdbc14.jar", then change the ojdbc used in the path where sqoop references (see library paths in $HADOOP_CLASSPATH) and remove the newer "ori18n.jar" to avoid invokation of newer version classes which don't exist in the old ojdbcIf version. This is because you use an old version of Oracle. If this response helped, please vote and accept it as a best answer.

I did a bit more research and found that you found the solution yourself. Please post an answer and accept it yourself. You are worth the HCC points.

View solution in original post

2 REPLIES 2

@Mustafa El-badry

could you please try the suggestions mentioned in the following post and see if it helps?

http://stackoverflow.com/questions/40567454/sqoop-imports-empty-strings-for-oracle-9i-table

@Mustafa El-badry

My recommendation is to downgrade the ojdbc with older version "ojdbc14.jar", then change the ojdbc used in the path where sqoop references (see library paths in $HADOOP_CLASSPATH) and remove the newer "ori18n.jar" to avoid invokation of newer version classes which don't exist in the old ojdbcIf version. This is because you use an old version of Oracle. If this response helped, please vote and accept it as a best answer.

I did a bit more research and found that you found the solution yourself. Please post an answer and accept it yourself. You are worth the HCC points.

View solution in original post