Skip to content

Planning error for compound expressions involving window functions #14910

@2010YOUY01

Description

@2010YOUY01

Describe the bug

The following query throws planning error for DataFusion, but it runs in DuckDB and PostgreSQL

Run in datafusion-cli (commit hash a28f283)

DataFusion CLI v45.0.0
> SELECT
  t1.v1,
  SUM(t1.v1) OVER w + 1
FROM
  generate_series(1, 10000) AS t1(v1)
WINDOW
  w AS (ORDER BY t1.v1 ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW);

Error during planning: Projection references non-aggregate values: Expression t1.v1 could not be resolved from available columns: sum(t1.v1)

To Reproduce

No response

Expected behavior

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions