yashaggarwal85d commented on code in PR #26637:
URL: https://github.com/apache/datafusion/pull/26637#discussion_r4379363880


##########
datafusion/physical-plan/src/aggregates/clustered_final_stream.rs:
##########
@@ -336,12 +338,19 @@ impl Aggregating {
             let timer = elapsed_compute.timer();
             self.table.aggregate_batch(&batch)?;
 
-            match reservation.try_resize(self.reservation_size()) {
-                Ok(()) => {}
-                Err(oom @ DataFusionError::ResourcesExhausted(_)) => {
-                    let Some(spill_context) = self.spill_context.as_mut() else 
{
-                        return Err(oom);
-                    };
+            // Check the reservation before taking completed groups, as the 
partial
+            // stream does, so spilling is unchanged. Without spilling, the 
refusal
+            // is returned below only if no group is complete.
+            let oom = match (

Review Comment:
   Makes sense. Switched it back to a nested match so the success path stays as 
it was (baa8fe5).



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