@Override
  public boolean listPartitionsByExpr(
      String dbName,
      String tblName,
      byte[] expr,
      String defaultPartitionName,
      short maxParts,
      List<Partition> result)
      throws TException {
    assert result != null;
    PartitionsByExprRequest req =
        new PartitionsByExprRequest(dbName, tblName, ByteBuffer.wrap(expr));
    if (defaultPartitionName != null) {
      req.setDefaultPartitionName(defaultPartitionName);
    }
    if (maxParts >= 0) {
      req.setMaxParts(maxParts);
    }
    PartitionsByExprResult r = null;
    try {
      r = client.get_partitions_by_expr(req);
    } catch (TApplicationException te) {
      // TODO: backward compat for Hive <= 0.12. Can be removed later.
      if (te.getType() != TApplicationException.UNKNOWN_METHOD
          && te.getType() != TApplicationException.WRONG_METHOD_NAME) {
        throw te;
      }
      throw new IncompatibleMetastoreException(
          "Metastore doesn't support listPartitionsByExpr: " + te.getMessage());
    }
    if (fastpath) {
      result.addAll(r.getPartitions());
    } else {
      r.setPartitions(filterHook.filterPartitions(r.getPartitions()));
      // TODO: in these methods, do we really need to deepcopy?
      deepCopyPartitions(r.getPartitions(), result);
    }
    return !r.isSetHasUnknownPartitions() || r.isHasUnknownPartitions(); // Assume the worst.
  }
Get list of partitions matching specified filter

@param dbName the database name
@param tblName the table name
@param filter the filter string, for example "part1 = \"p1_abc\" and part2 <= "\p2_test\"".
    Filtering can be done only on string partition keys.
@param maxParts the maximum number of partitions to return, all partitions are returned if -1
    is passed
@return list of partitions
@throws MetaException
@throws NoSuchObjectException
@throws TException
amoro-format-mixed/amoro-mixed-trino/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaStoreClient.java