@Test
  public void testListPartitionsByExr() throws Exception {
    createTable4PartColsParts(getClient());
    TestMetastoreExpr.ExprBuilder e = new TestMetastoreExpr.ExprBuilder(TABLE_NAME);
    checkExpr(2, e.strCol("yyyy").val("2017").pred("=", 2).build());
    checkExpr(3, e.strCol("mm").val("11").pred(">", 2).build());
    checkExpr(4, e.strCol("dd").val("29").pred(">=", 2).build());
    checkExpr(2, e.strCol("yyyy").val("2017").pred("!=", 2).build());
    checkExpr(1, e.strCol("yyyy").val("2017").pred("=", 2).strCol("mm").val("10")
        .pred(">=", 2).pred("and", 2).build());
    checkExpr(3, e.strCol("dd").val("10").pred("<", 2).strCol("yyyy").val("2009")
        .pred("!=", 2).pred("or", 2).build());
    checkExpr(0, e.strCol("yyyy").val("2019").pred("=", 2).build());
  }
Test class for list partitions with configurable include/exclude pattern on parameters.
Embedded Metastore uses JDO, Remote Metastore uses direct SQL to query the partitions:
MetaStoreFactoryForTests.getMetaStores()
ql/src/test/org/apache/hadoop/hive/metastore/TestListPartitionsWithXIncludeParams.java