So I'm trying to perform an update in an RDBMS table in MySQL. The thing is that this update is coming from a file in my HDFS and although in MySQL the table count with a primary key when I update the records the result sets came up with duplicated values in the description instead that update the previous record with the new key. In the example below the record Financial should came up just once with the value 9, but instead, I have two records the first with key 2 and the second with key 9.
My Sqoop code:
sqoop export --connect jdbc:mysql://xxxxxx/retail_export --username xxxxx --password xxxxx \
--table export_sqoop_dept --update-key id --update-mode allowinsert --export-dir /user/ingenieroandresangel/datasets/sqoop_export.txt \
-m 1
Thanks so much guys.
You have provided incorrect column with --update-key
.
Replace --update-key id
with --update-key id_dept
. If it doesn't work please check your data carefully. I would also recommend to use -input-fields-terminated-by
argument with your sqoop commanad.