Skip to content

feat(table): write gzip-compressed metadata for Java-conformant parity#17

Open
abnobdoss wants to merge 2 commits into
mainfrom
v3/w3-zstd
Open

feat(table): write gzip-compressed metadata for Java-conformant parity#17
abnobdoss wants to merge 2 commits into
mainfrom
v3/w3-zstd

Conversation

@abnobdoss

Copy link
Copy Markdown
Owner

No description provided.

Abanoub Doss 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.
@abnobdoss abnobdoss closed this Jun 25, 2026
@abnobdoss abnobdoss reopened this Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant