Skip to content

Invalid column reference in window function order by causes panic #9166

Description

@helgikrs

Describe the bug

This unwrap causes a panic when the referenced column doesn't exist in the schema.

To Reproduce

In datafusion-cli v35.0.0

❯ select count() over (order by a);
thread 'main' panicked at datafusion-sql-35.0.0/src/expr/function.rs:112:63:
called `Result::unwrap()` on an `Err` value: SchemaError(FieldNotFound { field: Column { relation: None, name: "a" }, valid_fields: [] }, Some(""))
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Expected behavior

A graceful error instead of a panic.

Additional context

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomers

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions