malon64 commented on PR #4496: URL: https://github.com/apache/iceberg-python/pull/4496#issuecomment-7409031415
Thanks again for testing @korsakowii, fixed in 29400f2. 1. The sequence number reuse is intended and matches Java. It only happens for the snapshot without a parent, i.e. the new main history the replace starts. As discussed in apache/iceberg#8390 (fixed by apache/iceberg#8469), that history has no existing files, so nothing in it is ordered against the other branch's snapshot with the same number. `last-sequence-number` still never goes down. 2. Not intended, I made the check too broad. An unpartitioned v1 table has nothing to carry forward, so it can become partitioned again when upgraded to v2. For v1 tables, partition IDs are only reused from the current spec, like Java's `reassignPartitionIds`, which keeps the duplicate ID fix. Staying on v1 with a partitioned spec is still rejected. While checking I found one more: the existing sequence check for snapshots with a parent raised `ValueError`, so a replace writing to a non-main branch left files behind when another branch moved, and plain transactions failed instead of retrying. It now raises `CommitFailedException`, which is what Java does (`RetryableValidationException` in `TableMetadata.Builder.addSnapshot`). This changes plain transactions too, happy to split it into its own PR if preferred. -- 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]
