2010YOUY01 commented on code in PR #24061:
URL: https://github.com/apache/datafusion/pull/24061#discussion_r3725856834


##########
datafusion/physical-plan/src/aggregates/hash_stream.rs:
##########
@@ -592,45 +826,42 @@ impl PartialHashAggregateStream {
     fn handle_skipping_aggregation(
         &mut self,
         cx: &mut Context<'_>,
-        mut original_state: PartialHashAggregateState,
+        original_state: PartialHashAggregateState,
     ) -> PartialHashAggregateStateTransition {
-        debug_assert!(matches!(
-            &original_state,
-            PartialHashAggregateState::SkippingAggregation { .. }
-        ));
+        let PartialHashAggregateState::SkippingAggregation { mut hash_table } =

Review Comment:
   I think the benefit of this pattern is, all the logic are implemented within 
this state function, and the main event loop `poll_next()` can be kept minimal, 
the entry-condition check like this one won't get scattered to 2 places.
   
   The downside, as you pointed out, is that it is more verbose. I don’t have a 
strong preference at this point.



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