public static List<PartitionSpec> filterPartitionSpecsIfEnabled(
      boolean isFilterEnabled,
      MetaStoreFilterHook filterHook,
      List<PartitionSpec> partitionSpecs) throws MetaException {
    if (isFilterEnabled) {
      return
          filterHook.filterPartitionSpecs(partitionSpecs);
    }

    return partitionSpecs;
  }
Filter the list of PartitionSpec 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 partitionSpecs: the list of PartitionSpec
@return the list of PartitionSpec 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