avantgardnerio commented on code in PR #24035:
URL: https://github.com/apache/datafusion/pull/24035#discussion_r3741800273
##########
datafusion/physical-plan/src/windows/bounded_window_agg_exec.rs:
##########
@@ -1042,9 +1103,45 @@ pub struct BoundedWindowAggStream {
/// partitions, so finished partitions are pruned eagerly instead and no
/// such bound is needed.
most_recent_row: Option<RecordBatch>,
+ /// Output partition index this stream serves; passed as the first
+ /// argument to [`WindowStateObserver::finalized`].
+ partition_idx: usize,
+ /// If set, invoked from [`Self::publish_finalized_states`] with the
+ /// finalized per-window-expression state for every partition key that is
+ /// about to be dropped.
+ state_observer: Option<Arc<dyn WindowStateObserver>>,
}
impl BoundedWindowAggStream {
+ /// Fire the [`WindowStateObserver`] for every partition key whose
+ /// `WindowAggState::is_end` is true.
+ fn publish_finalized_states(&mut self) -> Result<()> {
Review Comment:
I hoisted the guard to the caller - publish_finalized_states now always
mutates when called and takes the observer as a required arg
--
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]