window_funcs Expression Audits#
Audit notes for expressions in this category that have been audited. Absence of an entry means the expression has not been audited yet, not that it is unsupported. See the user guide Spark Expression Support for current support status.
avg (window)#
4.1.1, audited 2026-06-25:
AVG(<decimal>)over a window runs natively on Spark 4.x. Spark wraps the result asCast(avg(UnscaledValue(v)) / pow10 as decimal);CometWindowExec.convertunwraps that shape alongsideAlias(WindowExpression)andAlias(MakeDecimal(WindowExpression)), so theAvgDecimalnative window branch inprocess_agg_funcis reachable. Non-decimalAVGruns natively. Sliding-frame decimalAVGis guarded by the same fallback as decimalSUM(see below) so that it cannot hit the DataFusion built-in overflow divergence.
lag#
Supported via
CometWindowExec(operator level), not the expression serde.
lead#
Supported via
CometWindowExec(operator level), not the expression serde.
sum (window)#
4.1.1, audited 2026-06-25:
SUM(<decimal>)over a sliding window frame (lower bound notUNBOUNDED PRECEDING) falls back to Spark. The native sliding path would use DataFusion’s built-insum, which wraps on overflow rather than returning Spark’s NULL, and overflow cannot be detected at plan time, so the whole sliding decimalSUMcase falls back. Ever-expanding frames use Comet’s overflow-awareSumDecimalUDAF and run natively, matching Spark including overflow-to-NULL. Bigint slidingSUMoverflow matches Spark (both wrap) and stays native.