@Test
  public void testDirectSQLDropPartitionsCacheInSession()
      throws Exception {
    createPartitionedTable(false, false);
    // query the partitions with JDO
    List<Partition> partitions;
    try(AutoCloseable c = deadline()) {
      partitions = objectStore.getPartitionsInternal(DEFAULT_CATALOG_NAME, DB1, TABLE1,
          false, true, new GetPartitionsArgs.GetPartitionsArgsBuilder().max(10).build());
    }
    Assert.assertEquals(3, partitions.size());

    // drop partitions with directSql
    try(AutoCloseable c = deadline()) {
      objectStore.dropPartitionsInternal(DEFAULT_CATALOG_NAME, DB1, TABLE1,
          Arrays.asList("test_part_col=a0", "test_part_col=a1"), true, false);
    }
    try (AutoCloseable c = deadline()) {
      // query the partitions with JDO, checking the cache is not causing any problem
      partitions = objectStore.getPartitionsInternal(DEFAULT_CATALOG_NAME, DB1, TABLE1, false, true,
          new GetPartitionsArgs.GetPartitionsArgsBuilder().max(10).build());
    }
    Assert.assertEquals(1, partitions.size());
  }
Checks if the JDO cache is able to handle directSQL partition drops in one session.
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/TestObjectStore.java