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 with unparsing a TableScan with an alias and a filter.
Consider the following case:
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()?;
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 with unparsing a TableScan with an alias and a filter. Consider the following case:
The implementation of https://github.com/apache/datafusion/pull/12158 will produce a SQL like
but the SQL should be
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