zjw1111 opened a new pull request, #55897: URL: https://github.com/apache/arrow/pull/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. 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. On the four files in #55896, the median single-threaded scan time fell from 33.34 s to 28.55 s at 10,000 rows per batch (three runs per build). At 65,536 values, the existing decode benchmark showed throughput increases of 17.2% for Binary and 9.1% for BinaryView (seven repetitions, Clang 17 Release). ### 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:** - [ ] Human - [x] AI **Reviewed before submission by:** - [x] Human - [x] AI - [ ] Not reviewed * GitHub Issue: Closes #55896 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
