sankarh commented on a change in pull request #541: HIVE-21197 : Hive Replication can add duplicate data during migration to a target with hive.strict.managed.tables enabled URL: https://github.com/apache/hive/pull/541#discussion_r259587562
########## File path: ql/src/java/org/apache/hadoop/hive/ql/parse/ReplicationSpec.java ########## @@ -426,4 +427,14 @@ public static void copyLastReplId(Map<String, String> srcParameter, Map<String, destParameter.put(ReplicationSpec.KEY.CURR_STATE_ID.toString(), lastReplId); } } + + public boolean needDupCopyCheck() { + return needDupCopyCheck; + } + + public void setNeedDupCopyCheck(boolean isFirstIncDone) { + // During migration to transactional table, we need to check for duplicate copy. Check HIVE-21197 for more detail. + //Duplicate check is required only if its migration to txn table and first incremental load is not yet done. + this.needDupCopyCheck = (isMigratingToTxnTable && !isFirstIncDone); Review comment: This check depending on isMigratingToTxnTable is not so safe for future as caller may set it later as well. So, better to pass just a boolean which we set directly. Let caller decide, they need it or not. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services