3

I am newbie to SQOOP 1.4.5. I have gone through the sqoop documentation. I have successfully Imported / Exported the simple datatypes kinds of records to and from hdfs.

NEXT I TRIED FOR LOB DATA FOR EXAMPLE CLOB.

I have a simple CLOB table that Create Query is as following...

CREATE TABLE “SCOTT”.”LARGEDATA” (“ID” VARCHAR2(20 BYTE), “IMG” CLOB ) SEGMENT CREATION DEFERRED PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING TABLESPACE “USERS” LOB (“IMG”) STORE AS BASICFILE (TABLESPACE “USERS” ENABLE STORAGE IN ROW CHUNK 8192 RETENTION NOCACHE LOGGING );

I can successfully import data to hdsf

sqoop import –connect jdbc:oracle:thin:@:1522: –username –password –table ‘LARGEDATA’ -m 1 –target-dir /home/mydata/tej/LARGEDATA2 –fields-terminated-by , –escaped-by \\ –enclosed-by ‘\”‘

But when I tried to export this data BACK to ORACLE using following command

sqoop export –connect jdbc:oracle:thin:@:1522: –username –password –table ‘LARGEDATA’ -m 1 –export-dir /home/mydata/tej/LARGEDATA2 –fields-terminated-by , –escaped-by \\ –enclosed-by ‘\”‘

I got following exception

java.lang.CloneNotSupportedException: com.cloudera.sqoop.lib.ClobRef  at java.lang.Object.clone(Native Method)
java.io.IOException: Could not buffer record at org.apache.sqoop.mapreduce.AsyncSqlRecordWriter.write(AsyncSqlRecordWriter.java:218)

and the error metioned in this link https://stackoverflow.com/questions/30778340/sqoop-export-4000-characters-column-data-into-oracle-clob

I google about it and got following links that have mentioned that sqoop does not support export for BLOB and CLOB data. Out of that some are of Jul 2015 post. and some jira issue shown it is still opened. forum links are as following…

https://issues.apache.org/jira/browse/SQOOP-991 Can sqoop export blob type from HDFS to Mysql? http://sofb.developer-works.com/article/19310921/Can+sqoop+export+blob+type+from+HDFS+to+Mysql%3F http://grokbase.com/t/sqoop/user/148te4tghg/sqoop-import-export-clob-datatype Exporting sequence file to Oracle by Sqoop

Can anyone please let me know is SQOOP support export for LOB data? if yes then please guide me how can I do this?

Community
  • 1
  • 1
Tej Kiran
  • 2,218
  • 5
  • 21
  • 42

1 Answers1

0

Try creating a staging table in oracle and use --staging-table --clear-staging-table. Keep staging table column as varchar2(10000).

ny1902
  • 1