Update in sqoop export


#1

In sql database, I have one record. Say (1,Test1)
In hdfs I have 3 records. (1,Test1),(2,Test2),(3,Test3). When I run sqoop export with --update-key and update-mode allowinsert. All of the three records are getting copied. It should copy 2 records as one record is already there in the sql database.
Also, could anyone please share some sqoop export questions?
Thanks,
Sachit


#2

@connectsachit

The reason for duplicate records being inserted is due to non-availability of the primary key in your table your mentioning. please try to add primary key to the table and try export.

Just make sure you have a primary key in your MySQL table and you use that key as the update-key for allowinsert mode to work at its best.


#3

@chandanvarma
It worked. Thanks.
Could you also provide export practice questions link for CCA 175?


#4

@connectsachit

Below Link will be helpfull to you
https://www.youtube.com/watch?v=Q8hIVuRWbvk&list=PLf0swTFhTI8qZPHwjy4Hrh_NUlhLku5cx


#5