Skip to content

SQL: model GROUPS window frames #280

Open

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

Activity

  1. added
    enhancementNew feature or request
    sqlSQL front-end lowering (DataFusion → L2)
    windowWindow functions, frames, panes, or temporal semantics
    irPre-ASAP or post-ASAP intermediate representation
    on Aug 26, 2026
  2. zzylol commented on Aug 26, 2026

    @zzylol
    ContributorAuthor

    Related open work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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