private List<Partition> getPartitionsViaOrmFilter(String catName, String dbName, String tblName, ExpressionTree tree,
      boolean isValidatedFilter, List<FieldSchema> partitionKeys, boolean isAcidTable,
      GetPartitionsArgs args) throws MetaException {
    Map<String, Object> params = new HashMap<>();
    String jdoFilter =
        makeQueryFilterString(catName, dbName, tblName, tree, params, isValidatedFilter, partitionKeys);
    if (jdoFilter == null) {
      assert !isValidatedFilter;
      return null;
    }
    try (QueryWrapper query = new QueryWrapper(pm.newQuery(MPartition.class, jdoFilter))) {
      if (args.getMax() >= 0) {
        // User specified a row limit, set it on the Query
        query.setRange(0, args.getMax());
      }
      String parameterDeclaration = makeParameterDeclarationStringObj(params);
      query.declareParameters(parameterDeclaration);
      query.setOrdering("partitionName ascending");
      List<MPartition> mparts = (List<MPartition>) query.executeWithMap(params);
      LOG.debug("Done executing query for getPartitionsViaOrmFilter");
      pm.retrieveAll(mparts); // TODO: why is this inconsistent with what we get by names?
      LOG.debug("Done retrieving all objects for getPartitionsViaOrmFilter");
      List<Partition> results =
          convertToParts(catName, dbName, tblName, mparts, isAcidTable, args);
      return results;
    }
  }
Gets partition names from the table via ORM (JDOQL) filter pushdown.
@param tblName The table.
@param tree The expression tree from which JDOQL filter will be made.
@param isValidatedFilter Whether the filter was pre-validated for JDOQL pushdown by a client
  (old hive client or non-hive one); if it was and we fail to create a filter, we will throw.
@param args additional arguments for getting partitions
@return Resulting partitions. Can be null if isValidatedFilter is false, and
        there was error deriving the JDO filter.
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/ObjectStore.java