AmanBoronbaev opened a new pull request, #55772:
URL: https://github.com/apache/arrow/pull/55772

   ### Rationale for this change
   
   Skipping part of a Parquet page currently makes the column reader decode 
values into a heap buffer and discard them. Exposing the operation on the typed 
decoder lets a caller skip physical values directly and lets each encoding 
advance its own state. Closes #50453.
   
   ### What changes are included in this PR?
   
   Add `TypedDecoder::Skip` and use it in the column and record readers. 
Fixed-width PLAIN advances by byte width, PLAIN booleans advance the bit 
reader, and BYTE_STREAM_SPLIT advances within the first stream while retaining 
the original stride. DELTA_LENGTH_BYTE_ARRAY reuses its length traversal. Other 
decoders can use the default implementation, which calls their existing Decode 
in bounded stack batches.
   
   ### Are these changes tested?
   
   The new typed tests alternate skips and reads, check the next values and 
remaining count, and request more values than remain. They cover eight PLAIN 
physical types, five BYTE_STREAM_SPLIT types, DELTA_LENGTH_BYTE_ARRAY, and 
prefix-dependent DELTA_BYTE_ARRAY.
   
   Built with Clang in Release mode. All 193 encoding tests passed. The reader 
suite passed 189 tests and skipped four JSON printer tests that require 
simdjson 5 or later.
   
   For a public-API timing comparison, DuckDB wrote one uncompressed PLAIN 
INT64 column containing the integers 0 through 1,048,575, in eight row groups. 
Within each group the C++ reader repeatedly skipped 1,021 values and read and 
checked the next one, shortening the last skip to read the final row. With a 
warm filesystem cache the median time per whole-file scan was 2.60 ms at 
1259f85 and 2.04 ms with this change. This is a synthetic partial-page skip 
workload. Each build used the same compiler flags and CPU core, with 56 samples 
per build in alternating runs.
   
   ### Are there any user-facing changes?
   
   C++ consumers of `TypedDecoder` can now skip physical values without 
providing an output buffer.
   
   ### Was AI used for this PR?
   
   **PR code and description written by:**
   
   - [ ] Human
   - [x] AI
   
   **Reviewed before submission by:**
   
   - [ ] Human
   - [x] AI
   - [ ] Not reviewed
   


-- 
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]

Reply via email to