Skip to content

Incorrect results with expression resolution #10413

@alamb

Description

@alamb

Describe the bug

DataFusion will sometimes resolve expressions incorrectly when the alias shadows an expression

To Reproduce

DataFusion CLI v37.1.0
> select a + b from (select 1 as a, 2 as b, 1 as "a + b");
+-------+
| a + b |
+-------+
| 1     | <- Should be 3
+-------+
1 row(s) fetched.
Elapsed 0.009 seconds.

Expected behavior

Result should be 3

Additional context

This was found by @peter-toth in #10396

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions