How to import BLOB CLOB columns to Hive via Sqoop

sqoop import \
-Dmapred.job.queue.name=default \
–connect jdbc:oracle:thin:@hostname:port/port \
–username Xxxxxx \
–password XXXXXX \
–query “SELECT * FROM tablename WHERE \$CONDITIONS” \
–hive-drop-import-delims \
–map-column-java column1=String,column2=String \
-m 8 \
–hive-import \
–hive-table tablename \
–target-dir /user/hdfs/ \
–fields-terminated-by ’01’ \
–split-by id;

column1/2 — > Any CLOB/BLOB column converted to Java STRING value.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s