@Override
  protected List<VirtualColumnHandler> requestedVirtualColumns() {
    return asList(
            new VirtualColumnHandler(VirtualColumn.ROWID, (value) -> {
              OrcStruct rowId = (OrcStruct) value;
              if (value == null) {
                isNull = true;
                return;
              }
              recordIdentifier.setValues(((LongWritable) rowId.getFieldValue(Field.writeId.ordinal())).get(),
                      ((IntWritable) rowId.getFieldValue(Field.bucketId.ordinal())).get(),
                      ((LongWritable) rowId.getFieldValue(Field.rowId.ordinal())).get());
              isNull = false;
            }),
            new VirtualColumnHandler(VirtualColumn.ROWISDELETED, (value) -> {
              BooleanWritable deleted = (BooleanWritable) value;
              recordIdentifier.setDeleteEvent(deleted != null && deleted.get());
            }));
  }
BatchToRowReader that returns the rows readable by ORC IOs.
ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcOiBatchToRowReader.java