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 falls back to Spark on Spark 4.x. Spark wraps the result asCast(avg(UnscaledValue(v)) / pow10 as decimal), a shapeCometWindowExec.convertdoes not unwrap (it recognizes onlyAlias(WindowExpression)andAlias(MakeDecimal(WindowExpression))), so theAvgDecimalnative window branch inprocess_agg_funcis effectively dead on Spark 4.x. Results stay correct via fallback; this is a coverage gap, not a correctness divergence. Tracked by https://github.com/apache/datafusion-comet/issues/4731. Non-decimalAVGruns natively. Sliding-frame decimalAVGis additionally guarded by the same fallback as decimalSUM(see below) so that it cannot hit the DataFusion built-in overflow divergence once theCast(Divide(...))shape is recognized.
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.