rdblue commented on a change in pull request #1955:
URL: https://github.com/apache/iceberg/pull/1955#discussion_r545511060



##########
File path: 
spark3-extensions/src/main/scala/org/apache/spark/sql/catalyst/optimizer/RewriteDelete.scala
##########
@@ -77,33 +101,30 @@ object RewriteDelete extends Rule[LogicalPlan] with 
PredicateHelper with Logging
     PushDownUtils.pushFilters(scanBuilder, normalizedPredicates)
 
     val scan = scanBuilder.build()
-    val scanRelation = DataSourceV2ScanRelation(table, scan, output)
+    val scanRelation = DataSourceV2ScanRelation(table, scan, 
toOutputAttrs(scan.readSchema(), output))

Review comment:
       Spark's contract is that the scan's schema is the one that should be 
used, not the original table schema. This allows the merge scan to return the 
extra `_file` and `_pos` columns and matches the behavior of normal scans that 
are configured with `PushDownUtils.pruneColumns`.




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to