sankarh commented on a change in pull request #688: HIVE-21886 : REPL - With 
table list - Handle rename events during replace policy
URL: https://github.com/apache/hive/pull/688#discussion_r297668771
 
 

 ##########
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/events/AlterTableHandler.java
 ##########
 @@ -120,18 +121,18 @@ private boolean handleForTableLevelReplication(Context 
withinContext, String tbl
   }
 
   // Return true, if event needs to be dumped, else return false.
-  private boolean handleForTableLevelReplicationForRename(Context 
withinContext, String oldName, String newName) {
+  private boolean renameHandlerForTableLevelReplication(Context withinContext, 
String oldName, String newName) {
     // If the table is renamed after being added to the list of tables to be 
bootstrapped, then remove it from the
     // list of tables to be bootstrapped.
-    boolean oldTableIsPresent = 
withinContext.removeFromListOfTablesForBootstrap(oldName);
+    boolean oldTableInBootstrapList = 
withinContext.removeFromListOfTablesForBootstrap(oldName);
 
     ReplScope oldPolicy = withinContext.oldReplScope == null ? 
withinContext.replScope : withinContext.oldReplScope;
     if (ReplUtils.tableIncludedInReplScope(oldPolicy, oldName)) {
       // If old table satisfies the filter, but the new table does not, then 
the old table should be dropped.
       // This should be done, only if the old table is not in the list of 
tables to be bootstrapped which is a multi
       // rename case. In case of multi rename, only the first rename should do 
the drop.
       if (!ReplUtils.tableIncludedInReplScope(withinContext.replScope, 
newName)) {
-        if (oldTableIsPresent) {
+        if (oldTableInBootstrapList) {
           // If the old table was present in the list of tables to be 
bootstrapped, then just ignore the event.
           return false;
         } else {
 
 Review comment:
   A -> B where A doesn't matches old policy but B matches old but not new 
policy. So, no-op and don't dump event as well. Now, B -> C where B matches old 
policy and C doesn't match new policy. In this case, we add drop event for B 
which is wrong as it is missing in bootstrap list. Pls check if this is 
possible.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to