public static DiskRangeList planIndexReading(TypeDescription fileSchema,
      OrcProto.StripeFooter footer,
      boolean ignoreNonUtf8BloomFilter,
      boolean[] fileIncluded,
      boolean[] sargColumns,
      OrcFile.WriterVersion version,
      OrcProto.Stream.Kind[] bloomFilterKinds) {
    DiskRangeList.CreateHelper result = new DiskRangeList.CreateHelper();
    List<OrcProto.Stream> streams = footer.getStreamsList();
    // figure out which kind of bloom filter we want for each column
    // picks bloom_filter_utf8 if its available, otherwise bloom_filter
    if (sargColumns != null) {
      for (OrcProto.Stream stream : streams) {
        if (stream.hasKind() && stream.hasColumn()) {
          int column = stream.getColumn();
          if (sargColumns[column]) {
            switch (stream.getKind()) {
            case BLOOM_FILTER:
              if (bloomFilterKinds[column] == null &&
                  !(ignoreNonUtf8BloomFilter &&
                      hadBadBloomFilters(fileSchema.findSubtype(column)
                          .getCategory(), version))) {
                bloomFilterKinds[column] = OrcProto.Stream.Kind.BLOOM_FILTER;
              }
              break;
            case BLOOM_FILTER_UTF8:
              bloomFilterKinds[column] = OrcProto.Stream.Kind.BLOOM_FILTER_UTF8;
              break;
            default:
              break;
            }
          }
        }
      }
    }
    long offset = 0;
    for(OrcProto.Stream stream: footer.getStreamsList()) {
      if (stream.hasKind() && stream.hasColumn()) {
        int column = stream.getColumn();
        if (fileIncluded == null || fileIncluded[column]) {
          boolean needStream = false;
          switch (stream.getKind()) {
          case ROW_INDEX:
            needStream = true;
            break;
          case BLOOM_FILTER:
            needStream = bloomFilterKinds[column] == OrcProto.Stream.Kind.BLOOM_FILTER;
            break;
          case BLOOM_FILTER_UTF8:
            needStream = bloomFilterKinds[column] == OrcProto.Stream.Kind.BLOOM_FILTER_UTF8;
            break;
          default:
            // PASS
            break;
          }
          if (needStream) {
            result.addOrMerge(offset, offset + stream.getLength(), true, false);
          }
        }
      }
      offset += stream.getLength();
    }
    return result.get();
  }
Plans the list of disk ranges that the given stripe needs to read the
indexes. All of the positions are relative to the start of the stripe.
@param  fileSchema the schema for the file
@param footer the stripe footer
@param ignoreNonUtf8BloomFilter should the reader ignore non-utf8
                                encoded bloom filters
@param fileIncluded the columns (indexed by file columns) that should be
                    read
@param sargColumns true for the columns (indexed by file columns) that
                   we need bloom filters for
@param version the version of the software that wrote the file
@param bloomFilterKinds (output) the stream kind of the bloom filters
@return a list of merged disk ranges to read
llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/LlapRecordReaderUtils.java