apache / datafusion

Apache DataFusion SQL Query Engine
https://datafusion.apache.org/
Apache License 2.0
6.33k stars 1.2k forks source link

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

Open findepi opened 3 days ago

findepi commented 3 days ago

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

This pattern unfortunately does not currently work in DataFusion

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