private void testDeleteEventFiltering() throws Exception {
    boolean filterOn =
        HiveConf.getBoolVar(conf, HiveConf.ConfVars.FILTER_DELETE_EVENTS);
    int bucket = 0;
    AcidOutputFormat.Options options = new AcidOutputFormat.Options(conf)
        .filesystem(fs)
        .bucket(bucket)
        .writingBase(false)
        .minimumWriteId(1)
        .maximumWriteId(1)
        .inspector(inspector)
        .reporter(Reporter.NULL)
        .recordIdColumn(1)
        .finalDestination(root);

    int bucketProperty = BucketCodec.V1.encode(options);

    //create 3 insert deltas so that we have 3 splits
    RecordUpdater updater = new OrcRecordUpdater(root, options);

    //In the first delta add 2000 recs to simulate recs in multiple stripes.
    int numRows = 2000;
    for (int i = 1; i <= numRows; i++) {
      updater.insert(options.getMinimumWriteId(),
              new DummyRow(i, i-1, options.getMinimumWriteId(), bucket));
    }
    updater.close(false);

    options.minimumWriteId(2)
        .maximumWriteId(2);
    updater = new OrcRecordUpdater(root, options);
    updater.insert(options.getMinimumWriteId(),
        new DummyRow(4, 0, options.getMinimumWriteId(), bucket));
    updater.insert(options.getMinimumWriteId(),
        new DummyRow(5, 1, options.getMinimumWriteId(), bucket));
    updater.insert(options.getMinimumWriteId(),
        new DummyRow(6, 2, options.getMinimumWriteId(), bucket));
    updater.close(false);

    options.minimumWriteId(3)
        .maximumWriteId(3);
    updater = new OrcRecordUpdater(root, options);
    updater.insert(options.getMinimumWriteId(),
        new DummyRow(7, 0, options.getMinimumWriteId(), bucket));
    updater.insert(options.getMinimumWriteId(),
        new DummyRow(8, 1, options.getMinimumWriteId(), bucket));
    updater.insert(options.getMinimumWriteId(),
        new DummyRow(9, 2, options.getMinimumWriteId(), bucket));
    updater.close(false);

    //delete 1 row from each of the insert deltas
    options.minimumWriteId(4)
        .maximumWriteId(4);
    updater = new OrcRecordUpdater(root, options);
    updater.delete(options.getMinimumWriteId(),
        new DummyRow(-1, 0, 1, bucket));
    updater.delete(options.getMinimumWriteId(),
        new DummyRow(-1, 1, 2, bucket));
    updater.delete(options.getMinimumWriteId(),
        new DummyRow(-1, 2, 3, bucket));
    updater.close(false);

    conf.set(ValidTxnList.VALID_TXNS_KEY,
        new ValidReadTxnList(new long[0], new BitSet(), 1000, Long.MAX_VALUE).writeToString());
    //HWM is not important - just make sure deltas created above are read as
    // if committed
    conf.set(ValidWriteIdList.VALID_WRITEIDS_KEY,
        "tbl:5:" + Long.MAX_VALUE + "::");

    //now we have 3 delete events total, but for each split we should only
    // load 1 into DeleteRegistry (if filtering is on)
    List<OrcInputFormat.SplitStrategy<?>> splitStrategies = getSplitStrategies();
    assertEquals(1, splitStrategies.size());
    List<OrcSplit> splits = ((OrcInputFormat.ACIDSplitStrategy)splitStrategies.get(0)).getSplits();

    assertEquals(3, splits.size());
    assertEquals(root.toUri().toString() + File.separator +
            "delta_0000001_0000001_0000/bucket_00000",
        splits.get(0).getPath().toUri().toString());
    assertFalse(splits.get(0).isOriginal());

    assertEquals(root.toUri().toString() + File.separator +
            "delta_0000002_0000002_0000/bucket_00000",
        splits.get(1).getPath().toUri().toString());
    assertFalse(splits.get(1).isOriginal());

    assertEquals(root.toUri().toString() + File.separator +
            "delta_0000003_0000003_0000/bucket_00000",
        splits.get(2).getPath().toUri().toString());
    assertFalse(splits.get(2).isOriginal());

    VectorizedOrcAcidRowBatchReader vectorizedReader =
        new VectorizedOrcAcidRowBatchReader(splits.get(0), conf, Reporter.NULL,
            new VectorizedRowBatchCtx());
    ColumnizedDeleteEventRegistry deleteEventRegistry =
        (ColumnizedDeleteEventRegistry) vectorizedReader
            .getDeleteEventRegistry();
    assertEquals("number of delete events for stripe 1", filterOn ? 1 : 3,
        deleteEventRegistry.size());
    OrcRawRecordMerger.KeyInterval keyInterval =
        vectorizedReader.getKeyInterval();
    if(filterOn) {
      assertEquals(new OrcRawRecordMerger.KeyInterval(
          new RecordIdentifier(1, bucketProperty, 0),
          new RecordIdentifier(1, bucketProperty, numRows - 1)),
          keyInterval);
    }
    else {
      assertEquals(new OrcRawRecordMerger.KeyInterval(null, null), keyInterval);
    }

    vectorizedReader = new VectorizedOrcAcidRowBatchReader(splits.get(1), conf,
        Reporter.NULL, new VectorizedRowBatchCtx());
    deleteEventRegistry = (ColumnizedDeleteEventRegistry) vectorizedReader
        .getDeleteEventRegistry();
    assertEquals("number of delete events for stripe 2", filterOn ? 1 : 3,
        deleteEventRegistry.size());
    keyInterval = vectorizedReader.getKeyInterval();
    if(filterOn) {
      assertEquals(new OrcRawRecordMerger.KeyInterval(
          new RecordIdentifier(2, bucketProperty, 0),
          new RecordIdentifier(2, bucketProperty, 2)),
          keyInterval);
    }
    else {
      assertEquals(new OrcRawRecordMerger.KeyInterval(null, null), keyInterval);
    }

    vectorizedReader = new VectorizedOrcAcidRowBatchReader(splits.get(2), conf,
        Reporter.NULL, new VectorizedRowBatchCtx());
    deleteEventRegistry = (ColumnizedDeleteEventRegistry) vectorizedReader
        .getDeleteEventRegistry();
    assertEquals("number of delete events for stripe 3", filterOn ? 1 : 3,
        deleteEventRegistry.size());
    keyInterval = vectorizedReader.getKeyInterval();
    if(filterOn) {
      assertEquals(new OrcRawRecordMerger.KeyInterval(
          new RecordIdentifier(3, bucketProperty, 0),
          new RecordIdentifier(3, bucketProperty, 2)), keyInterval);
    }
    else {
      assertEquals(new OrcRawRecordMerger.KeyInterval(null, null), keyInterval);
    }
  }
Tests that we can figure out min/max ROW__ID for each split and then use
that to only load delete events between min/max.
This test doesn't actually check what is read - that is done more E2E
unit tests.
@throws Exception
ql/src/test/org/apache/hadoop/hive/ql/io/orc/TestVectorizedOrcAcidRowBatchReader.java