public static List<Integer> genIncludedColumnsReverse(
      TypeDescription readerSchema, boolean[] included, boolean isFullColumnMatch) {
    assert included != null;
    List<Integer> result = new ArrayList<>();
    List<TypeDescription> children = readerSchema.getChildren();
    for (int columnNumber = 0; columnNumber < children.size(); ++columnNumber) {
      TypeDescription child = children.get(columnNumber);
      int id = child.getId();
      int maxId = child.getMaximumId();
      if (id >= included.length || maxId >= included.length) {
        throw new AssertionError("Inconsistent includes: " + included.length
            + " elements; found column ID " + id);
      }
      boolean isIncluded = included[id];
      for (int col = id + 1; col <= maxId; ++col) {
        if (isFullColumnMatch && included[col] != isIncluded) {
          throw new AssertionError("Inconsistent includes: root column IDs are [" + id + ", "
              + maxId + "]; included[" + col + "] = " + included[col] + ", which is different "
              + " from the previous IDs of the same root column.");
        }
        isIncluded = isIncluded || included[col];
      }
      if (isIncluded) {
        result.add(columnNumber);
      }
    }
    return result;
  }
Reverses genIncludedColumns; produces the table columns indexes from ORC included columns.
@param readerSchema The ORC reader schema for the table.
@param included The included ORC columns.
@param isFullColumnMatch Whether full column match should be enforced (i.e. whether to expect
         that all the sub-columns or a complex type column should be included or excluded
         together in the included array. If false, any sub-column being included for a complex
         type is sufficient for the entire complex column to be included in the result.
@return The list of table column indexes.
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java