2017-08-08 40 views
0

所以我試圖在MySQL中的RDBMS表中執行更新。問題是這個更新來自我的HDFS中的一個文件,儘管在MySQL中,當我更新記錄時,表中包含主鍵,並且結果集在描述中出現了重複的值,而用新的鍵。在記錄下面的例子中財務應當與值9上前只有一次,而是,我有兩個記錄,先用鑰匙2,第二個具有關鍵9.RDBMS中的sqoop導出更新表記錄MySQL

enter image description here

我Sqoop代碼:

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 

非常感謝這麼多人。

回答

1

您提供了不正確的列與--update-key。 用--update-key id_dept替換--update-key id。如果不起作用,請仔細檢查您的數據。我還建議在您的sqoop commanad中使用-input-fields-terminated-by參數。

+0

我是如何迷路的朋友 –