Skip to content

Support RANGE window frames with an explicit offset on DATE or DECIMAL ORDER BY #4834

Description

@andygrove

Comet accelerates window functions with RANGE frames, but falls back to Spark when the frame uses an explicit PRECEDING/FOLLOWING offset and the ORDER BY column is DATE or DECIMAL.

See the fallbacks in spark/src/main/scala/org/apache/spark/sql/comet/CometWindowExec.scala (the RANGE-frame checks around lines 377-391):

  • DATE ORDER BY: falls back with "RANGE frame with explicit offset on DATE ORDER BY is not supported" because Date32 + Int32 frame arithmetic is not handled in the native comparator.
  • DECIMAL ORDER BY: falls back with "RANGE frame with explicit offset on DECIMAL ORDER BY is not supported" because decimal precision widening breaks the frame comparator.

Pure UNBOUNDED/CURRENT ROW RANGE frames on these order-by types already run natively; only explicit numeric offsets fall back.

Documented as a current limitation in the window function compatibility guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions