Support Questions

Find answers, ask questions, and share your expertise

Error with Sqoop import Blob data type

avatar
Contributor

I am trying to import an Oracle table using below sqoop command. The column REPORT_XML_DATA is of the form BLOB. When trying to export the below query, I am getting Error: java.io.IOException: SQLException in nextKeyValue Caused by: java.sql.SQLException: Invalid column type: getString not implemented for class oracle.jdbc.driver.T4CBlobAccessor

sqoop import --connect jdbc:oracle:thin:@xxxx:3000:ABCD --username TEST --password-file /user/test/mypassword.pwd  --query "select REPORT_XML_DATA from mydb.table_name WHERE \$CONDITIONS" --map-column-java REPORT_XML_DATA=String --target-dir /user/test/sqoop/table_name --m 1 --hive-import --hive-table table_name   --fields-terminated-by '\0174' --hive-drop-import-delims --null-string '\\N' --null-non-string '\\N' 

Error:

17/07/30 11:17:07 INFO mapreduce.Job: Task Id : attempt_1501271060971_7271_m_000000_1, Status : FAILED Error: java.io.IOException: SQLException in nextKeyValue at org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:277) at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:556) at org.apache.hadoop.mapreduce.task.MapContextImpl.nextKeyValue(MapContextImpl.java:80) at org.apache.hadoop.mapreduce.lib.map.WrappedMapper$Context.nextKeyValue(WrappedMapper.java:91) at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:145) 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:170) 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:1866) at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:164) Caused by: java.sql.SQLException: Invalid column type: getString not implemented for class oracle.jdbc.driver.T4CBlobAccessor at oracle.jdbc.driver.Accessor.unimpl(Accessor.java:414) at oracle.jdbc.driver.BlobAccessor.getString(BlobAccessor.java:335) at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:1297) at org.apache.sqoop.lib.JdbcWritableBridge.readString(JdbcWritableBridge.java:71) at com.cloudera.sqoop.lib.JdbcWritableBridge.readString(JdbcWritableBridge.java:61) at QueryResult.readFields(QueryResult.java:90) at org.apache.sqoop.mapreduce.db.DBRecordReader.nextKeyValue(DBRecordReader.java:244)

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Prabhat Ratnala

This should answer your question

Hope that helps

View solution in original post

4 REPLIES 4

avatar
Master Mentor

@Prabhat Ratnala

This should answer your question

Hope that helps

avatar
Contributor

@Shelton 

 

could you please repost the solution ??

I am facing similar issue.

 

separate thread for the same created 

https://community.cloudera.com/t5/Support-Questions/sqoop-import-of-BLOB-columns-from-oracle-databas...

 

Thanks in advance

avatar

@Prabhat Ratnala @Geoffrey Shelton Okot @Sandeep Nemuri

Hi,

Even I am facing the same issue. But I am trying to import the data into HDFS. Please let me know if you got any solution for this.

Thanks!

avatar
Master Mentor

@yothi k

Can you open a new thread the former was closed and was specific to blobs!

Please explain your situation and remember to give a description of your environment HDP/Ambari versions etc.

You may also incluse your sqoop script and log for the failed job.