private String getPartNameMatcher(Table table, List<String> partSpecs) throws MetaException {
    List<FieldSchema> partCols = table.getPartitionKeys();
    int numPartKeys = partCols.size();
    if (partSpecs.size() > numPartKeys) {
      throw new MetaException(
          "Incorrect number of partition values." + " numPartKeys=" + numPartKeys + ", partSpecs=" + partSpecs.size());
    }
    partCols = partCols.subList(0, partSpecs.size());
    // Construct a pattern of the form: partKey=partVal/partKey2=partVal2/...
    // where partVal is either the escaped partition value given as input,
    // or a regex of the form ".*"
    // This works because the "=" and "/" separating key names and partition key/values
    // are not escaped.
    String partNameMatcher = Warehouse.makePartName(partCols, partSpecs, ".*");
    // add ".*" to the regex to match anything else afterwards the partial spec.
    if (partSpecs.size() < numPartKeys) {
      partNameMatcher += ".*";
    }
    return partNameMatcher;
  }
getPartitionSpecsByFilterAndProjection interface is currently non-cacheable.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/cache/CachedStore.java