feat(table): write gzip-compressed metadata for Java-conformant parity#17
Open
abnobdoss wants to merge 2 commits into
Open
feat(table): write gzip-compressed metadata for Java-conformant parity#17abnobdoss wants to merge 2 commits into
abnobdoss wants to merge 2 commits into
Conversation
added 2 commits
June 23, 2026 10:16
PyIceberg could read .gz.metadata.json but never wrote compressed metadata: new_table_metadata_file_location always emitted .metadata.json and the standard `write.metadata.compression-codec` property was read nowhere in production code. This adds full read/write parity: - TableProperties.WRITE_METADATA_COMPRESSION (default "none", matching Java). - serializers: Compressor.from_codec_name() validates codec names and raises ValueError on unknown codecs (mirrors Java's Codec.fromName); metadata_file_extension() builds the filename suffix. - new_table_metadata_file_location honors the property and fails loudly on an unknown codec. - Read path now also handles legacy Java ".metadata.json.gz" files and experimental ".zst.metadata.json". - zstd is NON-STANDARD/experimental (Spark/Java cannot read it) and is clearly marked as such. - Version-parsing regex tolerates the codec infix and legacy suffix. Tests: codec detection, loud rejection of unknown codecs, and real on-disk round trips (gzip/zstd/none) via PyArrowFileIO.
Keep only gzip metadata-compression write parity. zstd produces metadata that Java/Spark cannot read (their codec set is NONE/GZIP only), so it must not be selectable via the standard write.metadata.compression-codec property. Also revert the .metadata.json.gz read/regex additions, which were unnecessary for write parity and left StaticTable.from_metadata mishandling that name. Strengthen the round-trip test to assert gzip magic bytes are actually written.
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.
No description provided.