private void setSARG(OrcRawRecordMerger.KeyInterval keyInterval,
      Reader.Options deleteEventReaderOptions,
      long minBucketProp, long maxBucketProp, long minRowId, long maxRowId) {
    SearchArgument.Builder b = null;
    if(keyInterval.getMinKey() != null) {
      RecordIdentifier k = keyInterval.getMinKey();
      b = SearchArgumentFactory.newBuilder();
      b.startAnd()  //not(ot < 7) -> ot >=7
          .startNot().lessThan(OrcRecordUpdater.ORIGINAL_WRITEID_FIELD_NAME,
          PredicateLeaf.Type.LONG, k.getWriteId()).end();
      b.startNot().lessThan(
          OrcRecordUpdater.BUCKET_FIELD_NAME, PredicateLeaf.Type.LONG, minBucketProp).end();
      b.startNot().lessThan(OrcRecordUpdater.ROW_ID_FIELD_NAME,
          PredicateLeaf.Type.LONG, minRowId).end();
      b.end();
    }
    if(keyInterval.getMaxKey() != null) {
      RecordIdentifier k = keyInterval.getMaxKey();
      if(b == null) {
        b = SearchArgumentFactory.newBuilder();
      }
      b.startAnd().lessThanEquals(
          OrcRecordUpdater.ORIGINAL_WRITEID_FIELD_NAME, PredicateLeaf.Type.LONG, k.getWriteId());
      b.lessThanEquals(OrcRecordUpdater.BUCKET_FIELD_NAME, PredicateLeaf.Type.LONG, maxBucketProp);
      b.lessThanEquals(OrcRecordUpdater.ROW_ID_FIELD_NAME, PredicateLeaf.Type.LONG, maxRowId);
      b.end();
    }
    if(b != null) {
      deleteEventSarg = b.build();
      LOG.info("deleteReader SARG(" + deleteEventSarg + ") ");
      deleteEventReaderOptions.searchArgument(deleteEventSarg,
          new String[] {
              OrcRecordUpdater.ORIGINAL_WRITEID_FIELD_NAME,
              OrcRecordUpdater.BUCKET_FIELD_NAME,
              OrcRecordUpdater.ROW_ID_FIELD_NAME
          });
      return;
    }
    deleteEventReaderOptions.searchArgument(null, null);
  }
Generates a SearchArgument to push down to delete_delta files.


Note that bucket is a bit packed int, so even thought all delete events
for a given split have the same bucket ID but not the same "bucket" value
{@link BucketCodec}
ql/src/java/org/apache/hadoop/hive/ql/io/orc/VectorizedOrcAcidRowBatchReader.java