You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by gi...@apache.org on 2026/08/12 21:55:21 UTC
(datafusion) 01/01: docs: Document `WindowFn` and add comments (#24118)
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-bbb552f71c93cdfadf91b374a3c4ff5f1a931ae7
in repository https://gitbox.apache.org/repos/asf/datafusion.git
commit 9b2f8ea3eac7fc4d192bf2624b56a5aad58a265d
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Wed Aug 12 21:54:57 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 <no...@anthropic.com>
---
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: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org