Repository navigation
Write manifests to the transaction's metadata location - #4523
Merged
Fokko merged 1 commit intoNov 30, 2026
Merged
Conversation
Snapshot producers wrote manifests and manifest lists using the location provider of the table the transaction started from, while data files use the transaction's metadata. A transaction that changes the location or write.metadata.path before writing would split its files between the old and new paths. Use the transaction's metadata for both, as Java does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
smaheshwar-pltr
commented
Nov 29, 2026
| def _location_provider(self) -> LocationProvider: | ||
| # Use the metadata of the transaction, as for data files, in case it changed the location or properties | ||
| table_metadata = self._transaction.table_metadata | ||
| return load_location_provider(table_location=table_metadata.location, table_properties=table_metadata.properties) |
Contributor
Author
There was a problem hiding this comment.
(Note that self._transaction._table.location_provider() which we had previously in new_manifest_output calls load_location_provider, so this isn't a new load per-manifest)
smaheshwar-pltr
marked this pull request as ready for review
November 29, 2026 23:32
Fokko
approved these changes
Nov 30, 2026
Fokko
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks @smaheshwar-pltr for the fix and the clear write-up! This matches Java, where TransactionTableOperations resolves metadata locations through ops.temp(current).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale for this change
A transaction can set
write.metadata.pathand then write data. The new metadata file and the data files go to the new locations, but the manifests and manifest list still go under the old metadata directory, because they're placed using the table's metadata from when the transaction started. For example, after settingwrite.data.pathandwrite.metadata.pathto/dataand/metadataand appending in one transaction:This PR places them using the transaction's metadata, as data files already are. Iceberg Java does the same through the transaction's table operations.
Are these changes tested?
Yes. A catalog test sets
write.metadata.pathand appends in the same transaction, then checks where the manifest list and manifests were written. It fails without the fix.Are there any user-facing changes?
Manifests and manifest lists written in a transaction go to a
write.metadata.pathset earlier in that transaction.AI Disclosure: This PR was authored by Claude Code (Opus 5.5) but directed and overseen by me.