Skip to content

Support for window functions in order by expression #608

Closed

Description

@jimexist

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
(This section helps Arrow developers understand the context and why for this feature, in addition to the what)

Describe the solution you'd like
A clear and concise description of what you want to happen.

Similar to PostgreSQL:

Window functions are permitted only in the SELECT list and the ORDER BY clause of the query.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Current behavior:

> select c2 from test order by max(c3) over (order by c9);
Plan("No field with unqualified name 'c9'")

Activity

  1. added a commit that references this issue on Oct 7, 2025
    1da28b5
  2. alamb commented on Mar 10, 2026

    @alamb
    Contributor

    This still happens (the error message is pretty ugly)

    > CREATE TABLE test (
        c2 INTEGER,
        c3 INTEGER,
        c9 INTEGER
      );
    0 row(s) fetched.
    Elapsed 0.023 seconds.
    
    > SELECT c2
      FROM test
      ORDER BY max(c3) OVER (ORDER BY c9);
    This feature is not implemented: Physical plan does not support logical expression WindowFunction(WindowFunction { fun: AggregateUDF(AggregateUDF { inner: Max { signature: Signature { type_signature: UserDefined, volatility: Immutable, parameter_names: None } } }), params: WindowFunctionParams { args: [Column(Column { relation: Some(Bare { table: "test" }), name: "c3" })], partition_by: [], order_by: [Sort { expr: Column(Column { relation: Some(Bare { table: "test" }), name: "c9" }), asc: true, nulls_first: false }], window_frame: WindowFrame { units: Range, start_bound: Preceding(Int32(NULL)), end_bound: CurrentRow, is_causal: false }, filter: None, null_treatment: None, distinct: false } })
  3. buraksenn commented on Mar 16, 2026

    @buraksenn
    Contributor

    take

  4. buraksenn commented on Mar 16, 2026

    @buraksenn
    Contributor

    I was working on this today and forgot to say take. Will open a PR soon

  5. added a commit that references this issue on Mar 25, 2026
    c4562dc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions