diff --git a/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/DVIterator.java b/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/DVIterator.java index e77e0cb64c84..2f929d61ce3a 100644 --- a/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/DVIterator.java +++ b/spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/DVIterator.java @@ -31,6 +31,7 @@ import org.apache.iceberg.relocated.com.google.common.collect.ImmutableList; import org.apache.iceberg.relocated.com.google.common.collect.Lists; import org.apache.iceberg.types.Types; +import org.apache.iceberg.util.ScanTaskUtil; import org.apache.spark.sql.catalyst.InternalRow; import org.apache.spark.sql.catalyst.expressions.GenericInternalRow; import org.apache.spark.unsafe.types.UTF8String; @@ -67,6 +68,7 @@ public boolean hasNext() { } @Override + @SuppressWarnings("checkstyle:CyclomaticComplexity") public InternalRow next() { long position = positions.next(); @@ -86,6 +88,10 @@ public InternalRow next() { rowValues.add(idToConstant.get(MetadataColumns.SPEC_ID_COLUMN_ID)); } else if (fieldId == MetadataColumns.FILE_PATH_COLUMN_ID) { rowValues.add(idToConstant.get(MetadataColumns.FILE_PATH_COLUMN_ID)); + } else if (null != projection.findField(MetadataColumns.CONTENT_OFFSET.fieldId())) { + rowValues.add(deleteFile.contentOffset()); + } else if (null != projection.findField(MetadataColumns.CONTENT_SIZE_IN_BYTES.fieldId())) { + rowValues.add(ScanTaskUtil.contentSizeInBytes(deleteFile)); } }