@Test
  public void testPartitionStatisticsOps() throws Exception {
    createPartitionedTable(true, true);

    List<List<ColumnStatistics>> stat;
    try (AutoCloseable c = deadline()) {
      stat = objectStore.getPartitionColumnStatistics(DEFAULT_CATALOG_NAME, DB1, TABLE1,
          Arrays.asList("test_part_col=a0", "test_part_col=a1", "test_part_col=a2"),
          Collections.singletonList("test_part_col"));
    }

    Assert.assertEquals(1, stat.size());
    Assert.assertEquals(3, stat.get(0).size());
    Assert.assertEquals(ENGINE, stat.get(0).get(0).getEngine());
    Assert.assertEquals(1, stat.get(0).get(0).getStatsObj().size());

    ColumnStatisticsData computedStats = stat.get(0).get(0).getStatsObj().get(0).getStatsData();
    ColumnStatisticsData expectedStats = new ColStatsBuilder<>(long.class).numNulls(1).numDVs(2)
        .low(3L).high(4L).hll(3, 4).kll(3, 4).build();
    assertEqualStatistics(expectedStats, computedStats);

    objectStore.deletePartitionColumnStatistics(DEFAULT_CATALOG_NAME, DB1, TABLE1,
        "test_part_col=a0", Arrays.asList("a0"), null, ENGINE);
    try (AutoCloseable c = deadline()) {
      stat = objectStore.getPartitionColumnStatistics(DEFAULT_CATALOG_NAME, DB1, TABLE1,
          Arrays.asList("test_part_col=a0", "test_part_col=a1", "test_part_col=a2"),
          Collections.singletonList("test_part_col"));
    }
    Assert.assertEquals(1, stat.size());
    Assert.assertEquals(2, stat.get(0).size());

    objectStore.deletePartitionColumnStatistics(DEFAULT_CATALOG_NAME, DB1, TABLE1,
        "test_part_col=a1", Arrays.asList("a1"), "test_part_col", null);
    try (AutoCloseable c = deadline()) {
      stat = objectStore.getPartitionColumnStatistics(DEFAULT_CATALOG_NAME, DB1, TABLE1,
          Arrays.asList("test_part_col=a0", "test_part_col=a1", "test_part_col=a2"),
          Collections.singletonList("test_part_col"));
    }
    Assert.assertEquals(1, stat.size());
    Assert.assertEquals(1, stat.get(0).size());

    objectStore.deletePartitionColumnStatistics(DEFAULT_CATALOG_NAME, DB1, TABLE1,
        "test_part_col=a2", Arrays.asList("a2"), null, null);
    try (AutoCloseable c = deadline()) {
      stat = objectStore.getPartitionColumnStatistics(DEFAULT_CATALOG_NAME, DB1, TABLE1,
          Arrays.asList("test_part_col=a0", "test_part_col=a1", "test_part_col=a2"),
          Collections.singletonList("test_part_col"));
    }
    Assert.assertEquals(0, stat.size());
  }
Checks if the directSQL partition drop removes every connected data from the RDBMS tables.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestObjectStore.java