maheshk114 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_r298015157
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/parse/repl/dump/events/AlterTableHandler.java
##########
@@ -168,10 +205,19 @@ public void handle(Context withinContext) throws
Exception {
}
}
- // If the tables are filtered based on name, then needs to handle the
rename scenarios.
- if (!withinContext.replScope.includeAllTables()) {
- if (!handleForTableLevelReplication(withinContext)) {
- LOG.info("Alter event for table " + before.getTableName() + " is
skipped from dumping");
+ // Handle renames for table level replication.
+ if ((Scenario.RENAME == scenario)
+ && (!withinContext.replScope.includeAllTables() ||
withinContext.oldReplScope != null)) {
+ String oldName = before.getTableName();
+ String newName = after.getTableName();
+ boolean needDump;
+ if (withinContext.oldReplScope == null) {
+ needDump = handleRenameForTableLevelReplication(withinContext,
oldName, newName);
+ } else {
+ needDump = handleRenameForReplacePolicy(withinContext, oldName,
newName);
+ }
+ if (!needDump) {
+ LOG.info("Rename event for table " + oldName + " is skipped from
dumping");
Review comment:
done
----------------------------------------------------------------
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]