@Override
          public void startQuery(Query query) {
            Region pr = CacheFactory.getAnyInstance().getRegion(PartitionedRegionName1);
            Region KeyRegion = null;
            for (int i = 6; i < 9; i++) {
              KeyRegion = ((PartitionedRegion) pr).getBucketRegion(i/* key */);
              if (KeyRegion != null) {
                KeyRegion.destroyRegion();
              }
            }
          }
Test on PR on one server only using filter.
geode-core/src/distributedTest/java/org/apache/geode/cache/query/dunit/QueryUsingFunctionContextDUnitTest.java