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

   ## Which issue does this PR close?
   
   - Closes #26575.
   
   ## Rationale for this change
   
   A `Partial` aggregate over input sorted on all grouping keys fails with 
`ResourcesExhausted` in a shared memory pool, although emitting the completed 
groups would leave only the active group in memory. This is a regression from 
54, see the issue for details.
   
   ## What changes are included in this PR?
   
   When the reservation after an input batch is refused under full group 
clustering, `ClusteredPartialAggregateStream` now emits the completed groups, 
the same rows the success path emits. It returns the error only when no group 
is complete.
   
   ## What is the testing strategy for this PR?
   
   New unit test `completed_groups_under_memory_pressure` in 
`clustered_partial_stream.rs`. It runs the stream with a limit that fits the 
table between batches but not after aggregating a batch, and compares the 
output with an unlimited run. It fails on `main` with `ResourcesExhausted`. It 
is a unit test because a SQL memory limit cannot target one stream's table size.
   
   ## Are there any user-facing changes?
   
   These queries now complete instead of failing. No API changes.
   


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