0

I am trying to export data to a db2 database using sqoop export with

--update-mode allowinsert
--update-key some_column

But I can’t determine if DB2 supports this feature. The sqoop export failure message is cryptic and doesn’t give any information as to what actually failed and I can’t find any examples of this being used specifically for DB2 anywhere.

Any information would be greatly appreciated.

2
  • Can you run in debug mode using the argument --verbose and post the log. Commented Jul 17, 2018 at 17:44
  • I did but unfortunately this does not provide any useful information either Commented Jul 17, 2018 at 17:50

1 Answer 1

0

After some further attempts/research, I found that DB2 does support

--update-key id

but does not yet have support for

--update-mode allowinsert

Meaning you cannot do upserts to DB2 using sqoop, but you can do updates and inserts separately. For updates, simply use --update-key id and for inserts, remove the argument altogether.

However, it should be noted that if your data set contains updates & inserts and you try to do an insert without the --update-key, the export will fail. You first need to separate your data into new records/updated records and then push each of them individually.

Lastly, doing an update where there are also new records will simply ignore the new records and will not fail. However, the new records will not be inserted even though the sqoop stdout tells you all records were exported.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.