feat(encoding): support u128 bitpacking for decimal128 columns#6858
Draft
LuciferYang wants to merge 1 commit into
Draft
feat(encoding): support u128 bitpacking for decimal128 columns#6858LuciferYang wants to merge 1 commit into
LuciferYang wants to merge 1 commit into
Conversation
decimal128(7,2) columns were stored at full 128-bit width without compression because BitPacking only supported u8/u16/u32/u64. This adds scalar u128 bitpacking, reducing decimal128 storage from 131 bits/value to ~24 bits/value (5.6x compression on TPC-DS store_sales). File size: 34 GiB → 16 GiB for store_sales SF=100.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Contributor
Author
|
Decoding performance has degraded. I need to explore possible optimizations to decide whether to move forward with this change. |
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.
Closes #6857.
What
Extends the miniblock inline-bitpacking chooser to also consider
bits = 128and adds a scalarBitPackingkernel foru128, sodecimal128columns whose values fit in <128 bits no longer fall through to raw 128-bit storage.Impact
Measured on TPC-DS SF=100
store_sales(288 M rows, 12 ×decimal128(7,2)columns):~53 % reduction, schema / row count / file format version (v2.1) unchanged.
Changes
rust/compression/bitpacking/src/lib.rs— scalar u128 BitPacking kernel.rust/lance-encoding/src/encodings/physical/bitpacking.rs— u128 miniblock encode / decode wiring.rust/lance-encoding/src/compression.rs— chooser now matchesbits ∈ {8, 16, 32, 64, 128}.rust/lance-encoding/src/statistics.rs— stat plumbing for the 128 case.+454 / -23across 4 files. No new public API, no on-wire format change (the new bit-width is already valid for v2.1 readers — the encoder just didn't previously emit it).Testing
width = 63boundary).compress → decompresstest through the miniblock path.store_salesverifies row count, schema, and reads back identically.Notes
Scalar only — no FastLanes-transposed kernel for u128 in this PR; that's a natural follow-up if decode throughput becomes a bottleneck.