AynSiddiqui commented on issue #2606:
URL: https://github.com/apache/iceberg-go/issues/2606#issuecomment-6959182958

   I'd like to work on this. I reproduced it on main (`03af0d2`) with a test 
that follows the five steps above: the scan fails with the same `uses partition 
spec 1, but data file ... uses partition spec 0` error.
   
   The v2 path already records each data file's spec ID and partition 
([transaction_delete.go](https://github.com/apache/iceberg-go/blob/03af0d2df524cc896422db7589d5acc4414d9f05/table/transaction_delete.go#L918)),
 but the fanout writer 
([pos_delete_partitioned_fanout_writer.go](https://github.com/apache/iceberg-go/blob/03af0d2df524cc896422db7589d5acc4414d9f05/table/pos_delete_partitioned_fanout_writer.go#L116-L120))
 gets its writers from a factory keyed by partition path only 
([rolling_data_writer.go](https://github.com/apache/iceberg-go/blob/03af0d2df524cc896422db7589d5acc4414d9f05/table/rolling_data_writer.go#L374-L397)),
 and the rolling writer stamps the table's current spec on every file it writes 
([rolling_data_writer.go](https://github.com/apache/iceberg-go/blob/03af0d2df524cc896422db7589d5acc4414d9f05/table/rolling_data_writer.go#L314)).
 Also, when the current spec is unpartitioned, the unpartitioned fast path is 
chosen from the current spec alone ([arrow_utils.go](https://git
 
hub.com/apache/iceberg-go/blob/03af0d2df524cc896422db7589d5acc4414d9f05/table/arrow_utils.go#L2447)),
 even if the target files were written under an older partitioned spec. The v3 
path already passes the data file's spec to the DV writer.
   
   Plan: pass the data file's spec to each position-delete writer, key the 
fanout writers by spec ID and partition, and keep the fast path only when every 
target file uses the current spec. Tests would cover the steps above, one 
Delete that hits files under two different specs, and evolution to an 
unpartitioned spec. Could I take this? I'll open a PR once you're OK with the 
approach.
   


-- 
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: [email protected]

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