Repository navigation
build(arrow)!: upgrade to 26.0.1 and require C++20 - #598
SteNicholas wants to merge 1 commit into
Conversation
1e5d99e to
9fcce87
Compare
|
I suggest removing Our copy shares the
|
|
Thanks for upgrading the Arrow version! @zjw1111 is running some read/write performance regressions now—let’s wait for his results. |
9fcce87 to
cd37bf4
Compare
cd37bf4 to
881a981
Compare
|
@lucasfang I removed @lxy-9602 and @zjw1111 I updated the benchmark section with the paired runs and the follow-up with longer warm-up. The uncompressed write result changed direction between runs, and the full scan remained 7.6% slower in the follow-up. The local Release builds use different fmt versions, so a matched comparison is still needed. The performance question remains open pending the independent results. |
37e2a42 to
cadde72
Compare
Arrow 17 vs. 26 performanceI compared Arrow 17.0.0 and 26.0.1 with Clang 17. On the 11-string-column table, direct Parquet scans took 4.86%–16.25% longer with Arrow 26, depending on batch size and decoding threads. Through Paimon For append writes, elapsed time changed by −1.8% to +0.6% across the three table shapes. All three stages of the default Zstd spill path were within 1%. Percentages below show the change in elapsed time relative to Arrow 17. Negative values mean Arrow 26 was faster. Repeated measurements are summarized by the median paired change. Direct Parquet reads on the 11-string-column tableBoth Arrow releases scanned the same four warm-cache Parquet files through
At 10,000 rows per batch and 0 threads, three profiled full scans had median elapsed times of 30.49 s on Arrow 17 and 35.44 s on Arrow 26. Stack sampling placed the extra time in dictionary-encoded string decoding: estimated CPU time in that call path, including its callees, rose from 20.44 s to 25.67 s. Zstd decompression took about 2.3 s on both releases, and kernel CPU time was 0.14–0.15 s. Two local changes to the Arrow 26 decoder tested that attribution. Forcing Cast performanceThe table-read benchmark measures how much of a full scan is spent converting columns. The microbenchmark measures the change in time per conversion relative to the same cast on Arrow 17. Paimon TableRead on older files after a schema changeBoth Paimon builds (Arrow 17 at
With the original types, Arrow 26 made zero data-column casts. With schema evolution, the additional cast time accounted for 4.3% of the Arrow 17 full-column scan time for one conversion and 4.8% for five conversions. Projecting only the ID and the column converted to Full-scan times are medians of three runs with uninstrumented builds. Separate paired runs timed the cast calls on the Arrow Compute array cast microbenchmarksOf 12 safe array casts tested through
The remaining six conversions had median changes between −2.7% and +3.8%. Numeric parsing used signed integer strings, including for the Paimon append writesEach version used
Arrow IPC and Paimon spillEach measurement covered three local spill files of 1,048,576 rows each, with warm-cache reads. The two versions produced identical file sizes for each codec and returned identical record batches, including nulls.
LZ4 batch decoding showed the largest IPC difference. With the same codec, iterating all key/value rows through Paimon’s Both builds used Clang 17.0.6 in Release mode with Arrow SIMD disabled. Benchmarks ran serially on the same host with CPU, memory, and disk I/O monitoring. |
|
Could we include the upstream We compared stock 26.0.1 with the same build plus just that patch, reading the same Parquet files on a single core. Across six paired runs, the patch reduced median scan time by 27.8% for a 600k-row group with 11 string columns and by 13.8% for a full scan of TPC-H |
2563794 to
1485c4b
Compare
Bundled Arrow and Parquet 17.0.0 lacked the upstream geospatial APIs needed by apache#580. Issue apache#596 calls for an Arrow upgrade and C++20 source builds while preserving C++17 compatibility for installed consumers. - Upgrade bundled Arrow and Parquet to 26.0.1, pin the archive by SHA-256 and disable bundled mimalloc. Backport the force-inlined arrow::Status destructor and null-free dictionary decode fast path. - Require C++20 and CMake 3.26 for source builds. Retire GCC 8 CI and build bundled Boost in C++17 for Lucene++. - Remove Arrow includes and the bundled ABI header from the public API. Forward-declare C Data structs in public headers and define ReadContext::HasReadSchema() out of line. - Port the Parquet patches and register compute kernels in static builds. Preserve byte-based page sizing, configurable page indexes and standard column statistics. - Skip empty row groups and retain page-filtered prefetch. Honor short asynchronous reads and keep shared files open through completion. - Preserve null-first sorting with per-key null placement, use Arrow's checked timestamp parser and report the URI on ORC schema errors. - Run the C++17 install smoke test in CI and cover async reads, empty row groups, dictionary decoding, Parquet options and ORC errors. Document build requirements, C++17 integration and timestamp bounds.
1485c4b to
e5c5385
Compare
|
@zjw1111 @lxy-9602 Thanks for the detailed profiling and upstream Arrow fixes! I updated
|
…-encoded BYTE_ARRAY batches (#55897) ### Rationale for this change While testing the Paimon C++ upgrade from Arrow 17 to 26, we found that scanning dictionary-encoded string columns slowed down at larger batch sizes. [Performance results in apache/paimon-cpp#598](apache/paimon-cpp#598 (comment)) The dense Parquet decoder already treats a null-free batch as a single valid run, but tracks both the remaining run length and a cursor into the index buffer. For these batches, every index read can be consumed immediately. ### What changes are included in this PR? Handle `null_count == 0` inside `DictByteArrayDecoderImpl::DecodeArrowDense`. Fill the existing 1,024-index buffer and append all indices returned by each read. Batches with nulls continue to use `VisitBitRuns`, retaining unused indices across null runs. Both paths share the index refill, dictionary bounds check, and value append logic. ### Are these changes tested? Existing `DictEncoding.CheckDecodeArrowUsingDenseBuilder` coverage checks the output values and decoded count for 10,000 values with zero, mixed, and all nulls across Binary, LargeBinary, BinaryView and their string counterparts. `DictEncoding.CheckDecodeArrowNonNullDenseBuilder` exercises the explicit non-null entry point across multiple index-buffer refills. Both validate the resulting arrays. The existing tests cover this change. ### Are there any user-facing changes? Reading null-free batches of dictionary-encoded Parquet strings or binary values into dense Arrow arrays can be faster. The table compares the original and optimized loops in Clang 17 Release builds. Each result is the median across runs. | Benchmark | Batch size | Runs per build | Before | After | Change | | --- | ---: | ---: | ---: | ---: | --- | | Single-threaded Parquet scan of the four files in #55896 | 10,000 rows | 3 | 33.34 s | 28.55 s | 14.37% less time | | Binary dictionary decode | 65,536 values | 7 | 189.68 MiB/s | 222.38 MiB/s | 17.24% higher throughput | | BinaryView dictionary decode | 65,536 values | 7 | 165.09 MiB/s | 180.14 MiB/s | 9.11% higher throughput | ### Was AI used for this PR? OpenAI Codex wrote the implementation and PR description. The contributor reviewed the code before submission. **PR code and description written by:** - [x] Human - [x] AI **Reviewed before submission by:** - [x] Human - [x] AI - [ ] Not reviewed * GitHub Issue: Closes #55896
…pend loop (#55940) ### Rationale for this change When Parquet decodes BYTE_ARRAY values into ordinary Arrow string or binary arrays, Clang and GCC Release builds can emit a call to `AppendValue` for every non-null value. This shows up in both dictionary and PLAIN decoding, even when the entire batch fits in the current output chunk. ### What changes are included in this PR? Move finishing the current chunk and reserving space in the next one into a single `ARROW_NOINLINE` helper. Both compilers then inline the common append path into the decode loop and call the helper only when the next value would exceed the 32-bit offset limit. ### Are these changes tested? Local boundary checks exercised both dictionary and PLAIN decoding with a value that exactly filled the current chunk, an empty string and a null at the limit, and a subsequent value that started a new chunk. The baseline and patched readers also produced matching SHA-256 digests over the decoded full-table output. ### Are there any user-facing changes? Single-threaded Parquet reads were faster on a string-heavy table. The timings below are median wall times for three full scans of the same four warm-cache files on Linux x86-64 (132,752,584 rows, 10,000 rows per batch). The baseline was `fbf6c9f846`. The GCC baseline measurement affected by CPU contention was repeated with the same CPU affinity. | Release compiler | Before | After | Reduction in scan time | | --- | ---: | ---: | ---: | | Clang 17.0.6 | 33.27 s | 29.56 s | 11.2% | | GCC 11.4.0 | 40.36 s | 29.24 s | 27.6% | The original upgrade benchmark compared Arrow 17.0.0 and 26.0.1 on the same four Parquet files. [Paimon C++ benchmark results](apache/paimon-cpp#598 (comment)) ### Was AI used for this PR? In accordance to the [AI generation guidelines](https://arrow.apache.org/docs/dev/developers/overview.html#ai-generated-code), please disclose below whether and how AI was used in this PR. **PR code and description written by:** - [x] Human - [x] AI **Reviewed before submission by:** - [x] Human - [x] AI - [ ] Not reviewed * GitHub Issue: Closes #55939 Drafted with assistance from OpenAI Codex.
Purpose
Linked issue: close #596
Upgrade bundled Arrow and Parquet from 17.0.0 to 26.0.1 in Paimon C++ to unblock the upstream Parquet geospatial APIs needed by #580.
mimalloc. Backport upstream Arrow's force-inlinedarrow::Statusdestructor (apache/arrow#50749) and null-free dictionary-encodedBYTE_ARRAYdecode fast path (apache/arrow#55897).<paimon/arrow/abi.h>header, forward-declaring Arrow C Data structs, and definingReadContext::HasReadSchema()out of line.FileReaderWrapperandGetRecordBatchReader.ArrowInputStreamAdapter, expose baseReadAtoverloads, and keep shared files and memory pools alive through completion.NullPlacement::AtStart, use Arrow's checked timestamp parser, and report the file URI on ORC schema metadata errors.Tests
paimon/api.handpaimon/schema/schema.h, verifying Paimon headers do not defineARROW_C_DATA_INTERFACE,<arrow/c/abi.h>statistics macros remain visible, andArrowSchemaownership round-trips throughReadContext.ArrowStreamAdapterTestcovering short and exact async reads, EOF and out-of-range errors,ReadManyAsync,ReadAt(..., allow_short_read),StorageReadBytesaccounting, and file/pool lifetimes on both successful and failed async reads.Create,PrepareForReading,PrepareForReadingLazy+ deferredSeekToRow, rawGetRecordBatchReader, and all-empty files), multi-refill dictionary-encoded batches (REQUIREDnon-null,OPTIONALzero-null, mixed-null, and all-null),large_utf8()page-filtered reads, byte-sized pages, page-index toggles, absent size statistics/histograms, writer peak-memory bounds, and Variant round trips.API and Format
<paimon/arrow/abi.h>; Arrow C Data structs are forward-declared andReadContext::HasReadSchema()is defined out of line. Consumers needing full C Data struct definitions should include<arrow/c/abi.h>from their Arrow provider (which works from C++17 without linking Arrow C++).max_rows_per_page(INT64_MAX)), configurable page indexes, and standard column statistics withSizeStatisticsLevel::Noneto match Arrow 17 output.Documentation
Yes. Updated
README.md,AGENTS.md,CONTRIBUTING.md,docs/code-style.md, anddocs/source/building.rstfor C++20 / CMake 3.26 source-build requirements;docs/source/build_system.rstfor C++17 consumer integration and<arrow/c/abi.h>migration; anddocs/source/user_guide/data_types.rstfor Arrow 26's acceptedTIMESTAMP(9)string range (1677-09-21 00:12:44through2262-04-11 23:47:16.854775807).Generative AI tooling
Generated-by: Google Antigravity