private KeyInterval discoverKeyBounds(Reader reader, Reader.Options options) {
    final RecordIdentifier[] keyIndex = OrcRecordUpdater.parseKeyIndex(reader);
    if (keyIndex == null) {
      LOG.warn("Missing '{}' metadata in ORC file, can't compute min/max keys",
          OrcRecordUpdater.ACID_KEY_INDEX_NAME);
      return new KeyInterval(null, null);
    }

    long offset = options.getOffset();
    long maxOffset = options.getMaxOffset();
    int firstStripe = 0;
    int stripeCount = 0;
    boolean isTail = true;
    RecordIdentifier minKey = null;
    RecordIdentifier maxKey = null;
    
    List<StripeInformation> stripes = reader.getStripes();
    for(StripeInformation stripe: stripes) {
      if (offset > stripe.getOffset()) {
        firstStripe += 1;
      } else if (maxOffset > stripe.getOffset()) {
        stripeCount += 1;
      } else {
        isTail = false;
        break;
      }
    }
    if (firstStripe != 0) {
      minKey = keyIndex[firstStripe - 1];
    }
    if (!isTail) {
      maxKey = keyIndex[firstStripe + stripeCount - 1];
    }
    return new KeyInterval(minKey, maxKey);
  }
Find the key range for the split (of the base) based on the 'hive.acid.key.index' metadata.
These keys are used to filter delta files since both are sorted by key.
If 'hive.acid.key.index' is missing from the ORC file, return null keys (which forces a full read).
@param reader the reader
@param options the options for reading with
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcRawRecordMerger.java