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

Query fails when using select *, followed/prefixed with explicit projections #13476

Open
findepi opened this issue Nov 18, 2024 · 0 comments · May be fixed by #13489
Open

Query fails when using select *, followed/prefixed with explicit projections #13476

findepi opened this issue Nov 18, 2024 · 0 comments · May be fixed by #13489
Labels
bug Something isn't working

Comments

@findepi
Copy link
Member

findepi commented Nov 18, 2024

Describe the bug

When doing interactive data exploration with wide tables/views with moderately expensive queries, it's very useful to run queries like

SELECT <important-columns, *
FROM ...
WHERE ...

This is useful because

  • whatever CLI/UI this is submitted over, the important columns are presented first by the presentation layer, making them easily accessible
  • should any additional information be needed, all the other columns are available, without re-running the query

This pattern unfortunately does not currently work in DataFusion

  • it's not possible to select all columns but put more important (from particular analysis perspective) columns first
  • as a result, a query needs to be run without * and whenever new column is needed, it needs to be re-run

To Reproduce

create table users (id int, name varchar, ........, registration_time timestamp);

select registration_time, id, * from users

Expected behavior

Query should succeed. It's valid ANSI SQL and supported by PostgreSQL, Trino, Snowflake, DuckDB, others

Additional context

No response

@findepi findepi added the bug Something isn't working label Nov 18, 2024
@findepi findepi changed the title Query fails when using `select *, followed/prefixed with explicit projections Query fails when using select *, followed/prefixed with explicit projections Nov 18, 2024
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