sankarh commented on a change in pull request #673: HIVE-21763: Incremental 
replication to allow changing include/exclude tables list in replication policy.
URL: https://github.com/apache/hive/pull/673#discussion_r294607244
 
 

 ##########
 File path: 
ql/src/java/org/apache/hadoop/hive/ql/parse/ReplicationSemanticAnalyzer.java
 ##########
 @@ -151,21 +154,49 @@ private void setReplDumpTablesList(Tree replTablesNode) 
throws HiveException {
       }
 
       if (listIdx == 0) {
-        LOG.info("ReplScope: Set Included Tables List: {}", tablesList);
+        LOG.info("{} ReplScope: Set Included Tables List: {}", replScopeType, 
tablesList);
         replScope.setIncludedTablePatterns(tablesList);
       } else {
-        LOG.info("ReplScope: Set Excluded Tables List: {}", tablesList);
+        LOG.info("{} ReplScope: Set Excluded Tables List: {}", replScopeType, 
tablesList);
         replScope.setExcludedTablePatterns(tablesList);
       }
     }
   }
 
+  private void setOldReplPolicy(Tree oldReplPolicyTree) throws HiveException {
+    oldReplScope = new ReplScope();
+    int childCount = oldReplPolicyTree.getChildCount();
+
+    // First child is DB name and optional second child is tables list.
+    assert(childCount <= 2);
+
+    // First child is always the DB name. So set it.
+    oldReplScope.setDbName(oldReplPolicyTree.getChild(0).getText());
+    LOG.info("Old ReplScope: Set DB Name: {}", oldReplScope.getDbName());
+    if (!oldReplScope.getDbName().equalsIgnoreCase(replScope.getDbName())) {
+      LOG.error("DB name {} cannot be replaced to {} in the replication 
policy.",
 
 Review comment:
   As discussed yesterday, we can keep dbName for readability. Also, it will be 
helpful to keep it complete repl policy if in future we want to support it for 
some use case.

----------------------------------------------------------------
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