Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema error: No field named "t.a". Valid fields are t.a. #9161

Closed
jonahgao opened this issue Feb 8, 2024 · 1 comment · Fixed by #9265
Closed

Schema error: No field named "t.a". Valid fields are t.a. #9161

jonahgao opened this issue Feb 8, 2024 · 1 comment · Fixed by #9265
Assignees
Labels
bug Something isn't working

Comments

@jonahgao
Copy link
Member

jonahgao commented Feb 8, 2024

Describe the bug

When a query includes both a CAST in its select list and a GROUP BY clause, it may fail.
For example:

select cast(a as int) from t group by t.a;

To Reproduce

Run the following queries in DataFusion CLI .

DataFusion CLI v35.0.0
❯ create table t(a bigint);
0 rows in set. Query took 0.007 seconds.

❯ select cast(a as int) from t group by t.a;
Schema error: No field named "t.a". Valid fields are t.a.

Expected behavior

Should be successful.

Additional context

No response

@jonahgao jonahgao added the bug Something isn't working label Feb 8, 2024
@jonahgao
Copy link
Member Author

jonahgao commented Feb 8, 2024

take

jonahgao added a commit to jonahgao/datafusion that referenced this issue Feb 19, 2024
alamb pushed a commit that referenced this issue Feb 28, 2024
* Add test to verify issue #9161

* fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant