From dd545cf6a8ac0832a0d6fe65048df35d3b0c23e0 Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Fri, 20 Jun 2025 08:41:52 -0400 Subject: [PATCH 1/2] Minor: Add documentation to `AggregateWindowExpr::get_result_column` --- datafusion/physical-expr/src/window/window_expr.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/datafusion/physical-expr/src/window/window_expr.rs b/datafusion/physical-expr/src/window/window_expr.rs index d994e8be1d24..84301c724aca 100644 --- a/datafusion/physical-expr/src/window/window_expr.rs +++ b/datafusion/physical-expr/src/window/window_expr.rs @@ -171,7 +171,7 @@ pub struct WindowPhysicalExpressions { } /// Extension trait that adds common functionality to [`AggregateWindowExpr`]s -pub trait AggregateWindowExpr: WindowExpr { +pub trait : WindowExpr { /// Get the accumulator for the window expression. Note that distinct /// window expressions may return distinct accumulators; e.g. sliding /// (non-sliding) expressions will return sliding (normal) accumulators. @@ -263,6 +263,15 @@ pub trait AggregateWindowExpr: WindowExpr { /// Calculates the window expression result for the given record batch. /// Assumes that `record_batch` belongs to a single partition. + /// + /// # Arguments + /// * `accumulator`: The accumulator to use for the calculation. + /// * `record_batch`: batch belonging to the current partition (see [`PartitionBatchState`]). + /// * `most_recent_row`: the batch that contains the most recent row, if available (see [`PartitionBatchState`]). + /// * `last_range`: The last range of rows that were processed (see [`WindowAggState`]). + /// * `window_frame_ctx`: Details about the window frame (see [`WindowFrameContext`]). + /// * `idx`: The index of the current row in the record batch. + /// * `not_end`: is the current row not the end of the partition (see [`PartitionBatchState`]). #[allow(clippy::too_many_arguments)] fn get_result_column( &self, From 818a5d90edeb72a7db27aa09c4fcde702823fd7b Mon Sep 17 00:00:00 2001 From: Andrew Lamb Date: Fri, 20 Jun 2025 17:15:29 -0400 Subject: [PATCH 2/2] Update datafusion/physical-expr/src/window/window_expr.rs --- datafusion/physical-expr/src/window/window_expr.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datafusion/physical-expr/src/window/window_expr.rs b/datafusion/physical-expr/src/window/window_expr.rs index 84301c724aca..dd671e068571 100644 --- a/datafusion/physical-expr/src/window/window_expr.rs +++ b/datafusion/physical-expr/src/window/window_expr.rs @@ -171,7 +171,7 @@ pub struct WindowPhysicalExpressions { } /// Extension trait that adds common functionality to [`AggregateWindowExpr`]s -pub trait : WindowExpr { +pub trait AggregateWindowExpr: WindowExpr { /// Get the accumulator for the window expression. Note that distinct /// window expressions may return distinct accumulators; e.g. sliding /// (non-sliding) expressions will return sliding (normal) accumulators.