[WIP] CLI program to write ALP encode example parquet files - #49154
Draft
alamb wants to merge 116 commits into
Draft
[WIP] CLI program to write ALP encode example parquet files#49154alamb wants to merge 116 commits into
alamb wants to merge 116 commits into
Conversation
Co-authored-by: Dhirhan Kanesalingam <dhirhan17@gmail.com>
Also ensure that no line exceeds 90 characters
This reverts commit e85658b42b5373ef7e54295b100d1f083d55dd8d.
Aligns with Arrow buffer conventions (Buffer::data() returns uint8_t*). This eliminates reinterpret_casts at parquet encoder/decoder call sites. Also updates kAlpVectorSize comment to reflect that arbitrary power-of-2 vector sizes are supported (1024 is just the default, not a limitation).
CreateSamplingPreset, EncodeWithPreset, Encode, and GetMaxCompressedSize now return Status / Result instead of aborting on invalid input. Callers in parquet/encoder.cc and the test suites updated; three EXPECT_DEATH tests converted to ASSERT_RAISES(Invalid, ...). Also in this commit: - Strip Snowflake attribution comments from encoding_alp_benchmark.cc - Pause timing around SetData in BM_AlpDecodingDouble so only Decode is measured - Slice data to output size in AlpSamplerTest.PresetGenerationDecimalData (the IsBitwiseEqual migration left this site with a 1024-vs-10000 size mismatch)
Replace ~250 lines of hand-rolled CSV parsing in encoding_alp_benchmark.cc with arrow::csv::TableReader, addressing reviewer feedback. Two helpers handle the three file shapes used by the benchmark: by-name lookup for header-bearing files, and by-index lookup (with optional header skip) for positional access used by the pipe-delimited and headerless datasets. Gate add_parquet_benchmark(encoding_alp_benchmark) on ARROW_CSV in src/parquet/CMakeLists.txt and emit a status message when skipped.
The reviewer suggested initializing `kStoredSize` from member sizes (`sizeof(exponent_) + sizeof(factor_) + sizeof(num_exceptions_)`) rather than from type names. The earlier attempt didn't compile because static data member initializers are evaluated in declaration order — the private members were declared below the public `kStoredSize`, so the names weren't visible yet. Moved the private data members to the top of each class so the public `kStoredSize` initializer can use `sizeof(member_)` directly. Dropped the out-of-class drift-guard `static_assert`, redundant once the member names are in the initializer.
alamb
force-pushed
the
alamb/example_encoding_writer
branch
from
August 3, 2026 21:59
7cb4f48 to
d873373
Compare
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.
This builds on the following PR from @prtkgaur
It contains a binary that creates files using the new ALP encoding here:
It was used to create the example in
I don't intend to merge this PR, rather I plan to use it to create test parquet files, and am posting the PR in case anyone else is interested.
To build
To run
build/release/parquet-write-parquet /tmp > /tmp/alp_details.txtThis writes a file like this to /tmp: alp_extended.zip
And writes detailed layout information to stdout
Output Encoding