You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "findepi (via GitHub)" <gi...@apache.org> on 2024/11/18 21:22:41 UTC

[I] Query fails when using `select *, followed/prefixed with explicit projections [datafusion]

findepi opened a new issue, #13476:
URL: https://github.com/apache/datafusion/issues/13476

   ### 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
   
   ```sql
   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_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org