You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "Fokko (via GitHub)" <gi...@apache.org> on 2026/07/06 19:26:01 UTC
Re: [PR] Support zstd blob decompression in Puffin [iceberg-python]
Fokko commented on code in PR #3575:
URL: https://github.com/apache/iceberg-python/pull/3575#discussion_r3531528120
##########
pyiceberg/table/puffin.py:
##########
@@ -68,7 +69,12 @@ def __init__(self, puffin: bytes) -> None:
self._file_bytes = puffin
def get_blob_payload(self, blob: PuffinBlobMetadata) -> bytes:
- return self._file_bytes[blob.offset : blob.offset + blob.length]
+ raw = self._file_bytes[blob.offset : blob.offset + blob.length]
+ if blob.compression_codec is None:
+ return raw
+ if blob.compression_codec == "zstd":
+ return zstandard.ZstdDecompressor().decompress(raw)
+ raise ValueError(f"Unsupported compression codec: {blob.compression_codec!r}")
Review Comment:
nit on style, for me this makes the flow more explicit:
```suggestion
if blob.compression_codec is None:
return raw
elif blob.compression_codec == "zstd":
return zstandard.ZstdDecompressor().decompress(raw)
else:
raise ValueError(f"Unsupported compression codec: {blob.compression_codec!r}")
```
--
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: issues-unsubscribe@iceberg.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org