2010YOUY01 commented on code in PR #23951:
URL: https://github.com/apache/datafusion/pull/23951#discussion_r3680371747
##########
datafusion/physical-plan/src/aggregates/ordered_partial_stream.rs:
##########
@@ -178,7 +159,80 @@ impl OrderedPartialAggregateStream {
reservation,
baseline_metrics,
reduction_factor,
- state: Some(OrderedPartialAggregateState::ReadingInput { table }),
+ table: Some(table),
+ })
+ }
+
+ pub(crate) fn into_stream(self) -> SendableRecordBatchStream {
+ let schema_clone = Arc::clone(&self.schema);
+
+ let cloned_metrics = self.baseline_metrics.clone();
+ let stream = Box::pin(RecordBatchStreamAdapter::new(
+ schema_clone,
+ self.create_stream(),
+ ));
+
+ Box::pin(ObservedStream::new(stream, cloned_metrics, None))
+ }
+
+ /// Entry point for the ordered partial aggregate state machine.
+ ///
+ /// See comments in [`OrderedPartialAggregateStream`] for high-level ideas.
+ ///
+ /// State transition graph:
Review Comment:
```suggestion
/// State transitions are implemented using the generator pattern; see
the comments in [`async_try_stream`].
///
/// Conceptual state-transition graph:
```
--
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]