SQOOP-621: Requesting support for upsert export with MySQL
Review Request #7588 - Created Oct. 15, 2012 and submitted
I've implemented upsert functionality using MySQL clause INSERT INTO ... ON DUPLICATE KEY UPDATE. This clause have slightly different purpose than Oracle's MERGE statement and therefore the functionality is slightly different. I've provided warning message notifying user that column names specified in --update-key parameter are not going to be used.
I've added new unit tests plus live testing.
Posted (Oct. 17, 2012, 6:01 p.m.)
Thanks for the patch Jarcec. Looks good overall, few comments: 1. Please update the doc. 2. Please fix ant checkstyle errors. I see 10 errors. 3. Few more minor comments below.
Minor. Can you please follow the ordering of import statements?
Can you add more test cases? Off the top of my head, I can think of at least 3 cases: 1) upsert all new rows. 2) upsert all existing rows. 3) upsert some new rows and some existing rows. Your test case combines 1 and 2. Wouldn't it make sense to break it up into separate cases and add a new case for 3? Let me know what you think.
Review request changed
Updated (Oct. 18, 2012, 4:21 a.m.)
- changed from pending to submitted