Skip to content

GH-55939: [C++][Parquet] Keep chunk rollover out of the BYTE_ARRAY append loop - #55940

Merged
HuaHuaY merged 1 commit into
apache:mainfrom
zjw1111:codex/parquet-binary-append
Dec 4, 2026
Merged

HuaHuaY merged 1 commit into
apache:mainfrom
zjw1111:codex/parquet-binary-append

Conversation

@zjw1111

@zjw1111 zjw1111 commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

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

Was AI used for this PR?

In accordance to the AI generation guidelines, please disclose below whether and how AI was used in this PR.

PR code and description written by:

  • Human
  • AI

Reviewed before submission by:

  • Human
  • AI
  • Not reviewed

Drafted with assistance from OpenAI Codex.

@HuaHuaY
HuaHuaY merged commit 33480b9 into apache:main Dec 4, 2026
64 of 108 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[C++][Parquet] Out-of-line binary append slows BYTE_ARRAY decoding

2 participants