@Test
  public void testFilterSinglePartition() throws Exception {
      String dbName = "filterdb";
      String tblName = "filtertbl";

      List<String> vals = new ArrayList<>(1);
      vals.add("p11");
      List <String> vals2 = new ArrayList<>(1);
      vals2.add("p12");
      List <String> vals3 = new ArrayList<>(1);
      vals3.add("p13");

      silentDropDatabase(dbName);

      new DatabaseBuilder()
          .setName(dbName)
          .create(client, conf);

      Table tbl = new TableBuilder()
          .setDbName(dbName)
          .setTableName(tblName)
          .addCol("c1", ColumnType.STRING_TYPE_NAME)
          .addCol("c2", ColumnType.INT_TYPE_NAME)
          .addPartCol("p1", ColumnType.STRING_TYPE_NAME)
          .create(client, conf);

      tbl = client.getTable(dbName, tblName);

      add_partition(client, tbl, vals, "part1");
      add_partition(client, tbl, vals2, "part2");
      add_partition(client, tbl, vals3, "part3");

      checkFilter(client, dbName, tblName, "p1 = \"p12\"", 1);
      checkFilter(client, dbName, tblName, "p1 < \"p12\"", 1);
      checkFilter(client, dbName, tblName, "p1 > \"p12\"", 1);
      checkFilter(client, dbName, tblName, "p1 >= \"p12\"", 2);
      checkFilter(client, dbName, tblName, "p1 <= \"p12\"", 2);
      checkFilter(client, dbName, tblName, "p1 <> \"p12\"", 2);
      checkFilter(client, dbName, tblName, "p1 like \"p1%\"", 3);
      checkFilter(client, dbName, tblName, "p1 like \"p%2\"", 1);

      client.dropTable(dbName, tblName);
      client.dropDatabase(dbName);
  }
Test filtering on table with single partition
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestHiveMetaStore.java