You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "goldmedal (via GitHub)" <gi...@apache.org> on 2024/09/07 07:10:42 UTC

[I] Unparsing TableScan with an alias and a pushdown filter to SQL string [datafusion]

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

   ### Is your feature request related to a problem or challenge?
   
   In https://github.com/apache/datafusion/pull/12158 , we support unparse a TableScan with some pushdown options(e.g. projection, filter, or fetch ...). However, there are some issues about unparsing an alias and a filter. 
   Consider the followed case:
   ```rust
       let table_scan_with_filter_alias = table_scan_with_filters(
           Some("t1"),  // projection
           &schema, // schema
           None,  // alias
           vec![col("id").gt(col("age"))],  // filter
       )?.alias("ta")?.build()?;
   ```
   The implementation of https://github.com/apache/datafusion/pull/12158 will produce a SQL like
   ```sql
   SELECT * FROM t1 AS ta WHERE (t1.id > t1.age)
   ```
   but the SQL should be
   ```SQL
   SELECT * FROM t1 AS ta WHERE (ta.id > ta.age)
   ```
   
   We need also to process the expression of the filter.
   
   ### Describe the solution you'd like
   
   Rewrite the columns used by the filter. Make their relation prefix be the alias instead of the table name.
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### 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


Re: [I] Unparsing TableScan with an alias and a pushdown filter to SQL string [datafusion]

Posted by "Lordworms (via GitHub)" <gi...@apache.org>.
Lordworms commented on issue #12368:
URL: https://github.com/apache/datafusion/issues/12368#issuecomment-2345186208

   take


-- 
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

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


Re: [I] Unparsing TableScan with an alias and a pushdown filter to SQL string [datafusion]

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #12368: Unparsing TableScan with an alias and a pushdown filter to SQL string
URL: https://github.com/apache/datafusion/issues/12368


-- 
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

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