Skip to content

Commit 3aff81c

Browse files
wgtmacsfc-gh-pgaur
authored andcommitted
apacheGH-48701: [C++][Parquet] Refactor and harden ALP encoding
Split the ALP implementation into constants, metadata, compression, sampler, and codec units. Simplify the internal APIs and update the CMake/Meson build integration. Remove the separate writer opt-in flag. ALP is selected explicitly with Encoding::ALP while dictionary encoding is disabled. Harden encoding and decoding: - validate page headers, vector metadata, offset chains, bit widths, element counts, and exception positions; - reject pages that leave ALP values unconsumed after all levels are read; - reuse pool-backed scratch buffers and cache partially decoded vectors; - use typed power-of-ten constants for exact decode semantics; - emit a valid header-only page for all-null input. Rework the ALP tests around the production APIs, remove redundant cases, and add malformed-input, boundary, exception, and all-null coverage. Move the end-to-end tests to arrow_encoding_test.cc and enable real parquet-testing interoperability coverage. Update the submodule pin, benchmarks, and C++ documentation.
1 parent 892b195 commit 3aff81c

27 files changed

Lines changed: 3003 additions & 5365 deletions

‎cpp/src/arrow/CMakeLists.txt‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,9 +550,10 @@ arrow_add_object_library(ARROW_VENDORED ${ARROW_VENDORED_SRCS})
550550

551551
set(ARROW_UTIL_SRCS
552552
util/align_util.cc
553-
util/alp/alp.cc
554-
util/alp/alp_codec.cc
553+
util/alp/alp_metadata.cc
554+
util/alp/alp_compression.cc
555555
util/alp/alp_sampler.cc
556+
util/alp/alp_codec.cc
556557
util/async_util.cc
557558
util/atfork_internal.cc
558559
util/basic_decimal.cc

‎cpp/src/arrow/meson.build‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,10 @@ arrow_components = {
165165

166166
arrow_util_srcs = [
167167
'util/align_util.cc',
168-
'util/alp/alp.cc',
169-
'util/alp/alp_codec.cc',
168+
'util/alp/alp_metadata.cc',
169+
'util/alp/alp_compression.cc',
170170
'util/alp/alp_sampler.cc',
171+
'util/alp/alp_codec.cc',
171172
'util/async_util.cc',
172173
'util/atfork_internal.cc',
173174
'util/basic_decimal.cc',

‎cpp/src/arrow/util/CMakeLists.txt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ add_arrow_test(bit-utility-test
111111
rle_encoding_test.cc
112112
test_common.cc)
113113

114-
add_arrow_test(alp-test SOURCES alp/alp_test.cc)
114+
add_arrow_test(encoding-utility-test
115+
SOURCES
116+
alp/alp_test.cc)
115117

116118
add_arrow_test(crc32-test
117119
SOURCES

0 commit comments

Comments
 (0)