hsnusonic commented on a change in pull request #2073:
URL: https://github.com/apache/hive/pull/2073#discussion_r605161646



##########
File path: 
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/FilterUtils.java
##########
@@ -442,4 +447,35 @@ public static void checkDbAndTableFilters(boolean 
isFilterEnabled,
       return compactions;
     }
   }
+
+  public static GetLatestCompactionInfoResponse 
filterLatestCompactionInfoIfEnabled(
+      boolean isFilterEnabled, MetaStoreFilterHook filterHook,
+      String catName, String dbName, String tableName, 
GetLatestCompactionInfoResponse response
+  ) throws MetaException {
+    if (isFilterEnabled && response.getCompactionsSize() > 0) {
+      List<LatestCompactionInfo> compactions = response.getCompactions();
+      if (compactions.get(0).getPartitionname() == null) {
+        // non partitioned table
+        List<String> tableNames = new ArrayList<>();
+        tableNames.add(tableName);
+        tableNames = filterHook.filterTableNames(catName, dbName, tableNames);
+        if (tableNames.isEmpty()) {
+          response.unsetCompactions();

Review comment:
       This is a method that is auto-generated by Thrift for 
`GetLatestCompactionInfo`.




-- 
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org
For additional commands, e-mail: gitbox-h...@hive.apache.org

Reply via email to