xiaobai0529 opened a new pull request, #26970:
URL: https://github.com/apache/datafusion/pull/26970

   ## Which issue does this PR close?
   
   Closes #26959
   
   ## Rationale for this change
   
   Window queries that need lookahead can emit batches larger than the 
configured batch size when buffered rows become ready together. For example, 
with batch size 2, a `ROWS ... 6 FOLLOWING` query can emit batches of 1, 2, and 
7 rows.
   
   ## What changes are included in this PR?
   
   Split computed output into zero-copy slices bounded by the configured batch 
size. Drain pending slices before reading more input, including after the input 
ends, preserving row order and window state.
   
   ## What is the testing strategy for this PR?
   
   - Added tests for lookahead at end of input, output values and batch sizes, 
and draining pending output before reading more input, including output 
metrics. The lookahead regression failed on the unmodified baseline with batch 
sizes `[1, 2, 7]`.
   - Ran the bounded window tests (13 passed), `cargo fmt --all`, and `cargo 
clippy --all-targets --all-features -- -D warnings`.
   - Ran the extended workspace test command required by `AGENTS.md` 
successfully. The isolated Linux test checkout used the pinned test-data 
submodules and LF line endings for the TPC-H q15 SQL file.
   - Ran the bounded-window linear dense count benchmark with 100 partitions 
using Criterion quick sampling: baseline 57.7–59.1 ms; modified 59.7–60.0 ms. 
This is one quick-sampled scenario, not a general performance claim.
   
   ## Are there any user-facing changes?
   
   Output from `BoundedWindowAggExec` respects the configured batch size. Query 
rows and their order are preserved; batch boundaries may change.
   
   ## AI assistance
   
   Codex (GPT-6) assisted with implementation, testing, and this description. 
The contributor reviewed the change and confirmed understanding of the design.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to