jackwener commented on code in PR #4484:
URL: https://github.com/apache/arrow-datafusion/pull/4484#discussion_r1037971421
##########
datafusion/sql/src/planner.rs:
##########
@@ -852,24 +836,12 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
// normalize name and alias
let table_name = normalize_sql_object_name(sql_object_name);
let table_ref: TableReference = table_name.as_str().into();
- let table_alias = alias.as_ref().map(|a|
normalize_ident(&a.name));
let cte = ctes.get(&table_name);
(
match (cte,
self.schema_provider.get_table_provider(table_ref)) {
- (Some(cte_plan), _) => match table_alias {
- Some(cte_alias) => {
- Ok(with_alias(cte_plan.clone(), cte_alias))
- }
- _ => Ok(cte_plan.clone()),
- },
+ (Some(cte_plan), _) => Ok(cte_plan.clone()),
(_, Ok(provider)) => {
- let scan =
- LogicalPlanBuilder::scan(&table_name,
provider, None);
- let scan = match table_alias.as_ref() {
- Some(ref name) =>
scan?.alias(name.to_owned().as_str()),
- _ => scan,
- };
- scan?.build()
Review Comment:
We must remove these code, because they will add `SubqueryAlias`.
But following code will be added once again, it will cause duplicated
`SubqueryAlias`
--
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]