Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

sqoop export upsert from parquet to oracle

sqoop export upsert from parquet to oracle

New Contributor

Hello,

I am trying to export data from a simple parquet table using sqoop to a simple oracle table with 3 columns.  Here is my oracle table: 

create table xref_tst ( retailer_nm varchar2(200), sku_id number, account_nbr int);

 

ALTER TABLE xref_tst
ADD CONSTRAINT sku_pk PRIMARY KEY (sku_id);

 

Here is my sqoop export statement.  Now when I run this first one below this it works fine and insert data into my empty oracle table.  But when I add the 2 update lines in the second at the end it won't insert into my empty table.  Does the update mode not work with hcatalog?  What am I missing?

 

works:

sqoop export \

--connect "jdbc:oracle:thin:@rmohsxd01.oracleoutsourcing.com:30712:db" \

--username user \

--password pass \

--table xref_tst \

--columns retailer_nm,sku_id,account_nbr \

--hcatalog-table "xref_testing " \

--hcatalog-database "sil_db"

 

doesn't work:

sqoop export \

--connect "jdbc:oracle:thin:@rmohsxd01.oracleoutsourcing.com:30712:db" \

--username user \

--password pass \

--table xref_tst \

--columns retailer_nm,sku_id,account_nbr \

--hcatalog-table "xref_testing " \

--hcatalog-database "sil_db" \

--update-key sku_id \

--update-mode allowinsert

1 REPLY 1
Highlighted

Re: sqoop export upsert from parquet to oracle

Expert Contributor

On the surface it looks like your second command should work too, since you've provided the --update-mode allowinsert parameter. Can you execute the second command with additional --verbose option and provide the output here?

Don't have an account?
Coming from Hortonworks? Activate your account here