private Collection<String> getPartitionPsQueryResults(String catName, String dbName,
                                                        String tableName, List<String> part_vals,
                                                        int max_parts, String resultsCol)
      throws MetaException, NoSuchObjectException {

    Preconditions.checkState(this.currentTransaction.isActive());

    catName = normalizeIdentifier(catName);
    dbName = normalizeIdentifier(dbName);
    tableName = normalizeIdentifier(tableName);
    Table table = getTable(catName, dbName, tableName, null);
    if (table == null) {
      throw new NoSuchObjectException(TableName.getQualified(catName, dbName, tableName) + " table not found");
    }
    // size is known since it contains dbName, catName, tblName and partialRegex
    // pattern
    Map<String, String> params = new HashMap<>(4);
    String filter = getJDOFilterStrForPartitionVals(table, part_vals, params);
    try (QueryWrapper query = new QueryWrapper(pm.newQuery(MPartition.class))) {
      query.setFilter(filter);
      query.declareParameters(makeParameterDeclarationString(params));
      if (max_parts >= 0) {
        // User specified a row limit, set it on the Query
        query.setRange(0, max_parts);
      }
      if (resultsCol != null && !resultsCol.isEmpty()) {
        query.setResult(resultsCol);
      }

      Collection<String> result = (Collection<String>) query.executeWithMap(params);

      return Collections.unmodifiableCollection(new ArrayList<>(result));
    }
  }
Retrieves a Collection of partition-related results from the database that match
 the partial specification given for a specific table.
@param dbName the name of the database
@param tableName the name of the table
@param part_vals the partial specification values
@param max_parts the maximum number of partitions to return
@param resultsCol the metadata column of the data to return, e.g. partitionName, etc.
       if resultsCol is empty or null, a collection of MPartition objects is returned
@return A Collection of partition-related items from the db that match the partial spec
         for a table.  The type of each item in the collection corresponds to the column
         you want results for.  E.g., if resultsCol is partitionName, the Collection
         has types of String, and if resultsCol is null, the types are MPartition.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java