dramaticlly commented on code in PR #10935: URL: https://github.com/apache/iceberg/pull/10935#discussion_r1733657338
########## spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/source/ChangelogRowReader.java: ########## @@ -112,13 +149,62 @@ private CloseableIterable<InternalRow> openChangelogScanTask(ChangelogScanTask t CloseableIterable<InternalRow> openAddedRowsScanTask(AddedRowsScanTask task) { String filePath = task.file().path().toString(); SparkDeleteFilter deletes = new SparkDeleteFilter(filePath, task.deletes(), counter()); - return deletes.filter(rows(task, deletes.requiredSchema())); + int[] indexes = indexesInRow(deletes.requiredSchema()); + + return CloseableIterable.transform( + deletes.filter(rows(task, deletes.requiredSchema())), + row -> { + InternalRow expectedRow = new GenericInternalRow(columns.length); + + for (int i = 0; i < columns.length; i++) { + expectedRow.update(i, row.get(indexes[i], sparkColumnTypes[i])); + } + + return expectedRow; + }); Review Comment: yeah I realized this as well when reading from RowDataReader, looks like if there's position delete present it will always add `pos` metadata column as required in https://github.com/apache/iceberg/blob/684f7a767c2c216a402b60b73d2d55ef605921a0/data/src/main/java/org/apache/iceberg/data/DeleteFilter.java#L260-L263, as well as equality delete id if equality delete are present. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org For additional commands, e-mail: issues-h...@iceberg.apache.org