@Override
    public HiveRow next() {
      if (!hasNext()) {
        throw new NoSuchElementException();
      }

      // position of the row as this batch is intended to be read (e.g. if batch is already filtered this
      // can be different from the physical position)
      int logicalPosition = currentPosition++;
      // real position of this row within the original (i.e unfiltered) batch
      int physicalPosition = originalIndices[logicalPosition];

      HiveRow row = new HiveRow() {

        @Override
        public Object get(int rowIndex) {

          if (rowIndex == MetadataColumns.ROW_POSITION.fieldId()) {
            if (fileRowOffset == Long.MIN_VALUE) {
              throw new UnsupportedOperationException("Can't provide row position for batch.");
            }
            return fileRowOffset + physicalPosition;
          } else {
            return vectorExtractRow.accessor(batch).apply(physicalPosition).apply(rowIndex);
          }
        }

        @Override
        public int physicalBatchIndex() {
          return physicalPosition;
        }

      };
      return row;
    }
File row position of the first row in this batch. Long.MIN_VALUE if unknown.
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/vector/HiveBatchContext.java