Skip to content

SQL: model GROUPS window frames #280

Description

@zzylol

Summary

PR #270 adds first-class window-frame data to SQLWindowFunc, but intentionally supports only ROWS and RANGE. DataFusion 43 also resolves GROUPS frames; lower_window_frame currently rejects WindowFrameUnits::Groups with UnsupportedFeature.

GROUPS counts peer groups defined by the window ordering rather than physical rows or value distance. It therefore needs its own canonical unit instead of being mapped to ROWS or RANGE.

Scope

  • Add WindowFrameUnits::Groups to the canonical IR.
  • Preserve DataFusion GROUPS start/end bounds, including finite, current-row, and unbounded bounds.
  • Thread the new unit through serialization, resolution, CSE hashing, and DAG export.
  • Replace the current rejection test with positive lowering coverage.

Acceptance criteria

  • GROUPS BETWEEN 2 PRECEDING AND CURRENT ROW lowers without UnsupportedFeature.
  • The resulting SQLWindowFunc.frame is structurally distinct from equivalent-looking ROWS and RANGE frames.
  • Serialization and CSE preserve the unit.
  • Tests cover finite and unbounded GROUPS bounds.

Post-ASAP execution of window frames is separate follow-up work; this issue is about lossless canonical representation and lowering.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestirPre-ASAP or post-ASAP intermediate representationsqlSQL front-end lowering (DataFusion → L2)windowWindow functions, frames, panes, or temporal semantics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions