This is an automated email from the ASF dual-hosted git repository. github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-24118-f956fd1128d1ba419747dbd3ff10aac695ecf158 in repository https://gitbox.apache.org/repos/asf/datafusion.git
commit f3ef45a53c9b59fe3e4802e08d9f878dbead9655 Author: Andrew Lamb <[email protected]> AuthorDate: Sat Aug 15 11:04:48 2026 +0000 docs: Document `WindowFn` and add comments (#24118) ## Which issue does this PR close? - N/A (documentation only) ## Rationale for this change The `WindowFn` enum in `datafusion-physical-expr` has no documentation, and its `Builtin` variant name is misleading: ## What changes are included in this PR? Doc comments on `WindowFn` and its two variants, including links to the `WindowExpr` implementations that create each variant. ## Are these changes tested? By CI ## Are there any user-facing changes? Improved API documentation only; no code changes. --------- Co-authored-by: Claude Fable 5 <[email protected]> --- datafusion/physical-expr/src/window/window_expr.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/datafusion/physical-expr/src/window/window_expr.rs b/datafusion/physical-expr/src/window/window_expr.rs index 1c52ea4ea6..7fe768cfbe 100644 --- a/datafusion/physical-expr/src/window/window_expr.rs +++ b/datafusion/physical-expr/src/window/window_expr.rs @@ -610,9 +610,16 @@ pub(crate) fn get_orderby_values(order_by_columns: Vec<SortColumn>) -> Vec<Array order_by_columns.into_iter().map(|s| s.values).collect() } +/// State for incrementally evaluating a window function +/// within a partition, created by [`WindowExpr::create_window_fn`]. #[derive(Debug)] pub enum WindowFn { + /// A "normal" window function, such as `lead` or `lag`, evaluated via a + /// [`PartitionEvaluator`]. Despite the name, it is used for all window + /// functions that are not aggregate functions. Builtin(Box<dyn PartitionEvaluator>), + /// An aggregate function used as a window function, such as `avg` or + /// `sum`, which is evaluated via an [`Accumulator`]. Aggregate(Box<dyn Accumulator>), } --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
