public static List<String> filterPartitionNamesIfEnabled(
      boolean isFilterEnabled,
      MetaStoreFilterHook filterHook,
      final String catName, final String dbName,
      final String tableName, List<String> partitionNames) throws MetaException {
    if (isFilterEnabled) {
      return
          filterHook.filterPartitionNames(catName,
              dbName, tableName, partitionNames);
    }

    return partitionNames;
  }
Filter the list of partitions if filtering is enabled. Otherwise, return original list
@param isFilterEnabled true: filtering is enabled; false: filtring is disabled.
@param filterHook: the object that does filtering
@param catName: the catalog name
@param dbName: the database name
@param tableName: the table name
@param partitionNames: the list of partition names
@return the list of partitions that current user has access if filtering is enabled;
        Otherwise, the original list
@throws MetaException
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/FilterUtils.java