Repository navigation
Conversation
| EXPECT_EQ(blob_result.second, ToBytes("hello puffin")); | ||
| } | ||
|
|
||
| TEST(PuffinRoundTripTest, ZstdCompressedBlobs) { |
There was a problem hiding this comment.
The Java fixtures cover Java writer → C++ reader compatibility. Could we preserve a reverse-direction check for C++ writer →
Java reader as well? I verified it locally for empty, binary, repetitive, and incompressible payloads. The check should compare decoded payloads and metadata, since different zstd implementations can produce different valid compressed bytes.
There was a problem hiding this comment.
Idea is good, But i don't expect including this PR. If we checks c++ -> java reader here, then we should cover go, python, rust also and other language have to do same ways vice-versa. I don't think that is realistic.
In datasketches, we have tck repo(https://github.com/apache/datasketches-tck) for that. iceberg has iceberg-verification for same reason.
I think iceberg also handles binary compatability checks there.
how do you think? I will send serialized file generation PR later.
|
|
||
| std::vector<std::byte> output(frame_size); | ||
| const size_t decompressed_size = | ||
| ZSTD_decompress(output.data(), output.size(), input.data(), input.size()); |
There was a problem hiding this comment.
The Puffin spec requires one Zstd frame. An extra empty frame still passes this size check. Can we check that a single standard frame spans the entire blob and add a regression test?
There was a problem hiding this comment.
Can you show me which case? Because i already have "frame_then_skippable_frame" and "frame_then_empty_frame" case.
There was a problem hiding this comment.
Sorry, my comment was on the previous commit. I think these cases are perfect!
| return NotSupported("LZ4 decompression is not yet supported"); | ||
| case PuffinCompressionCodec::kZstd: | ||
| return NotSupported("Zstd decompression is not yet supported"); | ||
| case PuffinCompressionCodec::kZstd: { |
There was a problem hiding this comment.
Could we move the zstd code into two small internal functions, like we do for gzip? That would keep the Puffin switch focused on choosing the codec. Perhaps we can also abstract out a CompressionCodec class?
There was a problem hiding this comment.
I refactored to util: 6172bfd
making abstract class looks good to me, but how about handling next PR?
issue: #1192
This is first step. Adding zstd compression and decompression logic.
disclosure: I got helps from opus 5.5 for writing test code.