mustafasrepo opened a new issue, #6439:
URL: https://github.com/apache/arrow-datafusion/issues/6439

   ### Is your feature request related to a problem or challenge?
   
   Some database systems (such as snowflake) support EXCLUDE syntax, during 
projection.
   For instance, the query below
   ```sql
   SELECT * EXCLUDE(sn)
     FROM sales_us
   ```
   show all the columns except sn, this saves user to write explicitly each 
desired column.
   
   ### Describe the solution you'd like
   
   I would like to have this support.
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   To replicate problem, one can use the test below
   ```rust
   #[tokio::test]
   async fn test_exclude_syntax() -> Result<()> {
       let config = SessionConfig::new()
           .with_target_partitions(1);
       let ctx = SessionContext::with_config(config);
       ctx.sql("CREATE TABLE sales_us (
         ts TIMESTAMP,
         currency VARCHAR(3),
         amount INT
       ) as VALUES
             ('2022-01-01 10:00:00'::timestamp, 'USD', 100.00),
             ('2022-01-01 11:00:00'::timestamp, 'USD', 200.00),
             ('2022-01-02 09:00:00'::timestamp, 'USD', 300.00),
             ('2022-01-02 10:00:00'::timestamp, 'USD', 150.00)").await?;
   
       let sql = "SELECT * EXCLUDE(sn)
                       FROM sales_us";
   
       let msg = format!("Creating logical plan for '{sql}'");
       let dataframe = ctx.sql(sql).await.expect(&msg);
       let physical_plan = dataframe.create_physical_plan().await?;
       let batches = collect(physical_plan, ctx.task_ctx()).await?;
       print_batches(&batches)?;
       Ok(())
   }
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to