private void advance() {
    if (!advanced) {
      try {

        if (!recordReader.next(key, batch)) {
          batch.size = 0;
        }

        if (batch.size != 0 && recordReader instanceof RowPositionAwareVectorizedRecordReader) {
          rowOffset = ((RowPositionAwareVectorizedRecordReader) recordReader).getRowNumber();
        }

        // Fill partition values
        if (partitionColIndices != null) {
          for (int i = 0; i < partitionColIndices.length; ++i) {
            int colIdx = partitionColIndices[i];
            // The partition column might not be part of the current projection - in which case no CV is inited
            if (batch.cols[colIdx] != null) {
              vrbCtx.addPartitionColsToBatch(batch.cols[colIdx], partitionValues[i], partitionColIndices[i]);
            }
          }
        }
        // Fill virtual columns
        for (VirtualColumn vc : vrbCtx.getNeededVirtualColumns()) {
          Object value;
          int idx = vrbCtx.findVirtualColumnNum(vc);
          switch (vc) {
            case PARTITION_SPEC_ID:
              value = idToConstant.get(MetadataColumns.SPEC_ID.fieldId());
              vrbCtx.addPartitionColsToBatch(batch.cols[idx], value, idx);
              break;
            case PARTITION_HASH:
              value = IcebergAcidUtil.computeHash(
                      (StructProjection) idToConstant.get(MetadataColumns.PARTITION_COLUMN_ID));
              vrbCtx.addPartitionColsToBatch(batch.cols[idx], value, idx);
              break;
            case FILE_PATH:
              value = idToConstant.get(MetadataColumns.FILE_PATH.fieldId());
              BytesColumnVector bcv = (BytesColumnVector) batch.cols[idx];
              if (value == null) {
                bcv.noNulls = false;
                bcv.isNull[0] = true;
                bcv.isRepeating = true;
              } else {
                bcv.fill(((String) value).getBytes());
              }
              break;
            case ROW_POSITION:
              value = LongStream.range(rowOffset, rowOffset + batch.size).toArray();
              LongColumnVector lcv = (LongColumnVector) batch.cols[idx];
              lcv.noNulls = true;
              Arrays.fill(lcv.isNull, false);
              lcv.isRepeating = false;
              System.arraycopy(value, 0, lcv.vector, 0, batch.size);
              break;
            case PARTITION_PROJECTION:
              bcv = (BytesColumnVector) batch.cols[idx];
              bcv.noNulls = false;
              bcv.isNull[0] = true;
              bcv.isRepeating = true;
              break;
          }
        }
      } catch (IOException ioe) {
        throw new RuntimeException(ioe);
      }
      advanced = true;
    }
  }
Iterator wrapper around Hive's VectorizedRowBatch producer (MRv1 implementing) record readers.
iceberg/iceberg-handler/src/main/java/org/apache/iceberg/mr/hive/vector/HiveBatchIterator.java