From 1dd2ba84f036d745c746a171399ee60e93343408 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Wed, 5 Nov 2025 12:24:45 -0700 Subject: [PATCH] clarify supported window expressions --- docs/source/user-guide/latest/expressions.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/source/user-guide/latest/expressions.md b/docs/source/user-guide/latest/expressions.md index 3ccead03a1..d323cab054 100644 --- a/docs/source/user-guide/latest/expressions.md +++ b/docs/source/user-guide/latest/expressions.md @@ -200,6 +200,19 @@ incompatible expressions. | VariancePop | | Yes | | | VarianceSamp | | Yes | | +## Window Functions + +Comet supports using aggregate functions within window contexts with PARTITION BY and ORDER BY clauses. Window frames (ROWS and RANGE) are supported with various bounds (UNBOUNDED PRECEDING, UNBOUNDED FOLLOWING, CURRENT ROW, and numeric offsets). + +| Expression | Spark-Compatible? | Compatibility Notes | +| ---------- | ----------------- | -------------------------------------------- | +| Count | Yes | Aggregate function used in window context | +| Max | Yes | Aggregate function used in window context | +| Min | Yes | Aggregate function used in window context | +| Sum | Yes | Aggregate function used in window context | + +**Note:** Dedicated window functions such as `rank`, `dense_rank`, `row_number`, `lag`, `lead`, `ntile`, `cume_dist`, `percent_rank`, and `nth_value` are not currently supported and will fall back to Spark. + ## Array Expressions | Expression | Spark-Compatible? | Compatibility Notes |