0

I'm using sqoop export command to upsert(update and insert) records in Oracle SQL server from hive. For this, I'm using the following command in hadoop:

hadoop jar sqoop-job-launcher-0.0.1.jar com.myclass.sqoop.SqoopLauncher sqoop export --connect 'SQLconnectionString' --table 'SQLtableName' --update-mode allowinsert --update-key roll --hcatalog-database 'HiveDatabaseName' --hcatalog-table 'hiveTableName' --input-null-string null

The above command runs fine when using only the primary key('roll' is the primary key above). But if I need to update the records in SQL with a set of keys such as "name,roll", how can that be done?

Adarsh Kumar
  • 113
  • 2
  • 15

1 Answers1

0

Starting from sqoop 1.4.0 it is possible to specify comma separated list as udate_key : https://issues.apache.org/jira/browse/SQOOP-313

Use concat(name,roll) for older versions, or create additional synthetic PK in the table.

leftjoin
  • 36,950
  • 8
  • 57
  • 116