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

 ##########
 File path: ql/src/java/org/apache/hadoop/hive/ql/exec/repl/ReplLoadTask.java
 ##########
 @@ -364,6 +367,35 @@ private void cleanTablesFromBootstrap() throws 
HiveException, IOException, Inval
     }
   }
 
+  /**
+   * If replication policy is changed between previous and current load, then 
the excluded tables in
+   * the new replication policy will be dropped.
+   * @throws HiveException Failed to get/drop the tables.
+   */
+  private void dropTablesExcludedInReplScope(ReplScope replScope) throws 
HiveException {
+    // If all tables are included in replication scope, then nothing to be 
dropped.
+    if ((replScope == null) || replScope.includeAllTables()) {
+      return;
+    }
+
+    Hive db = getHive();
+    String dbName = replScope.getDbName();
+
+    // List all the tables that are excluded in the current repl scope.
+    Iterable<String> tableNames = Collections2.filter(db.getAllTables(dbName),
+        tableName -> {
+          assert(tableName != null);
+          return !tableName.toLowerCase().startsWith(
 
 Review comment:
   why prepare the list ..can we not just drop the table ?

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