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


##########
datafusion/physical-plan/src/aggregates/single_stream.rs:
##########
@@ -123,47 +124,18 @@ pub(crate) struct SingleHashAggregateStream {
     /// Memory reservation for group keys, accumulators, and spill sorting.
     reservation: MemoryReservation,
 
-    /// Tracks the high-level stream lifecycle. The hash table owns the 
lower-level
-    /// state for emitting output batches.
-    state: Option<SingleHashAggregateState>,
-
     /// See the "Optimization: DISTINCT LIMIT Soft Limit" section in
     /// [`SingleHashAggregateStream`] for details.
     group_values_soft_limit: Option<usize>,
-}
 
-/// See comments at `poll_next()` for details.
-enum SingleHashAggregateState {

Review Comment:
   Given the complexity of this operator, I think it would be helpful to encode 
the different stages of its lifecycle as typed states.
   
   Here is a pattern to follow which uses generator and enum state together:
   
https://github.com/apache/datafusion/blob/1d9be2e10794994fc1495c35363658dc7db0adf7/datafusion/physical-plan/src/aggregates/ordered_final_stream.rs#L65-L83



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