jackwener commented on code in PR #4484:
URL: https://github.com/apache/arrow-datafusion/pull/4484#discussion_r1037975460
##########
datafusion/sql/src/planner.rs:
##########
@@ -921,25 +887,31 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
plan: LogicalPlan,
alias: TableAlias,
) -> Result<LogicalPlan> {
- let columns_alias = alias.clone().columns;
- if columns_alias.is_empty() {
- // sqlparser-rs encodes AS t as an empty list of column alias
Review Comment:
Original code is bug (add twice) + bug (when columns-alias, forget to add
alias). let me have explain.
The process is as follows
- Add table-alias (above those code are removed)
- Add table-alias and columns-alias (these code here)
- bug: when columns-alias is empty, these code will ignore table-alias
So
- bug (add twice) will cause replicated subquery_alias
- bug (when columns-alias, forget to add alias) will cause missing
subquery_alias
so we just unify them into
- Add table-alias and columns-alias
--
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]