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

   ### Is your feature request related to a problem or challenge?
   
   Part of https://github.com/apache/datafusion/issues/9726 to complete the 
LogialPlan --> SQL conversion
   
   Converting `LogicalPlan` back to `SQL` is valuable for several usecases such 
as using DataFusion to programatically create SQL -- see the 
[`plan_to_sql.rs`](https://github.com/apache/datafusion/blob/main/datafusion-examples/examples/plan_to_sql.rs)
 example
   
   ### Describe the solution you'd like
   
   Support converting SQL with window functions like this:
   
   ```sql
   SELECT first_value OVER (x ORDER BY y) FROM foo;
   ```
   
   ### Describe alternatives you've considered
   
   The basic pattern is this (see 
https://github.com/apache/datafusion/pull/10371 for an example):
   
   1.  Implement the LogicalPlan --> AST reverse code in 
`Unparser::plan_to_sql`([source 
link](https://github.com/apache/datafusion/blob/8bedecc00b2f1f04d7b1a907152ce0d19b7046a5/datafusion/sql/src/unparser/plan.rs#L411-L413))
 
   3. Add a test in `roundtrip_statement` in `sql_integration.rs` [source 
link](https://github.com/apache/datafusion/blob/8bedecc00b2f1f04d7b1a907152ce0d19b7046a5/datafusion/sql/tests/sql_integration.rs#L4619)
   
   Note you can run the tests like 
   
   ```shell
   cargo test -p datafusion-sql -- roundtrip_statement
   ```
   
   ### Additional context
   
   I think this is a good first issue as the pattern is well established and 
there are explicit instructions


-- 
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-unsubscr...@datafusion.apache.org.apache.org

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


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

Reply via email to