Core: Implement LZ4 frame compression for Puffin format#16054
Core: Implement LZ4 frame compression for Puffin format#16054laserninja wants to merge 2 commits into
Conversation
9062543 to
5ad0ae5
Compare
5ad0ae5 to
3895aaa
Compare
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
|
This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions. |
| This product bundles lz4-java. | ||
|
|
||
| Copyright: 2020 Adrien Grand and the lz4-java contributors | ||
| Project URL: https://github.com/lz4/lz4-java |
There was a problem hiding this comment.
should this be https://github.com/yawkat/lz4-java ?
lz4/lz4-java is discontinued and awkat/lz4-java is now maintained community fork.
similar for all LICENSE
Implement LZ4 frame compression and decompression in PuffinFormat using lz4-java (net.jpountz.lz4), which was already defined in the version catalog but not wired as a dependency of iceberg-core. The Puffin spec requires LZ4 single compression frame with content size present. The existing aircompressor library only provides block-level LZ4, not frame-level, so lz4-java's LZ4FrameOutputStream and LZ4FrameInputStream are used instead. Previously, compress() and decompress() had TODO stubs for LZ4 that threw UnsupportedOperationException at runtime, making footer compression (which defaults to LZ4) unusable. Fixes apache#16033
Regenerate runtime-deps.txt baselines for all runtime modules (Spark v3.5/v4.0/v4.1, Flink v1.20/v2.0/v2.1, Kafka Connect) to include the lz4-java dependency. Add lz4-java attribution to the corresponding LICENSE files, referencing the maintained fork at https://github.com/yawkat/lz4-java.
8b7d47b to
665eb6c
Compare
What
Implements LZ4 frame compression and decompression in
PuffinFormat, fixing theUnsupportedOperationExceptionthrown when attempting to use LZ4 compression (which is the default for Puffin footer compression).Why
The
compress()anddecompress()methods inPuffinFormathad TODO stubs for the LZ4 case that fell through tothrow new UnsupportedOperationException("Unsupported codec: lz4"). This made footer compression — which defaults to LZ4 per the Puffin spec — unusable at runtime.How
lz4-java(net.jpountz.lz4) as a dependency toiceberg-core. The library was already defined in the version catalog (gradle/libs.versions.toml) but was not wired as a dependency.compressLz4()usingLZ4FrameOutputStreamwithCONTENT_SIZEandBLOCK_INDEPENDENCEflags, conforming to the Puffin spec requirement of "LZ4 single compression frame with content size present".decompressLz4()usingLZ4FrameInputStream.aircompressorlibrary only provides block-level LZ4, not the frame-level compression required by the Puffin spec.lz4-javaprovides the necessary frame format support.Testing
TestPuffinFormatfor both non-empty and empty data.testEmptyFooterCompressedinTestPuffinWriter— previously assertedUnsupportedOperationException, now verifies successful LZ4 footer compression and read-back.testWriteAndReadMetricDataCompressedLz4inTestPuffinWriterfor full write + read verification with LZ4-compressed blobs.All existing Puffin tests continue to pass.
Fixes #16033