@Override public List<String> listPartitionNamesPs(String catName, String dbName, String tblName,
      List<String> partSpecs, short maxParts) throws MetaException, NoSuchObjectException {
    catName = StringUtils.normalizeIdentifier(catName);
    dbName = StringUtils.normalizeIdentifier(dbName);
    tblName = StringUtils.normalizeIdentifier(tblName);
    if (!shouldCacheTable(catName, dbName, tblName) || (canUseEvents && rawStore.isActiveTransaction())) {
      return rawStore.listPartitionNamesPs(catName, dbName, tblName, partSpecs, maxParts);
    }
    Table table = sharedCache.getTableFromCache(catName, dbName, tblName);
    if (table == null) {
      // The table is not yet loaded in cache
      return rawStore.listPartitionNamesPs(catName, dbName, tblName, partSpecs, maxParts);
    }
    String partNameMatcher = getPartNameMatcher(table, partSpecs);
    List<String> partitionNames = new ArrayList<>();
    List<Partition> allPartitions = sharedCache.listCachedPartitions(catName, dbName, tblName, maxParts);
    int count = 0;
    for (Partition part : allPartitions) {
      String partName = Warehouse.makePartName(table.getPartitionKeys(), part.getValues());
      if (partName.matches(partNameMatcher) && (maxParts == -1 || count < maxParts)) {
        partitionNames.add(partName);
        count++;
      }
    }
    return partitionNames;
  }
getPartitionSpecsByFilterAndProjection interface is currently non-cacheable.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java