zzwqqq commented on code in PR #4748:
URL: https://github.com/apache/calcite/pull/4748#discussion_r2694729036


##########
core/src/main/java/org/apache/calcite/rel/rel2sql/SqlImplementor.java:
##########
@@ -2242,12 +2243,37 @@ public SqlSelect asSelect() {
       if (node instanceof SqlSelect) {
         return (SqlSelect) node;
       }
-      if (!dialect.hasImplicitTableAlias()) {
+      if (!dialect.hasImplicitTableAlias() || hasConflictTableAlias(node, 
neededAlias)) {
         return wrapSelect(asFrom());
       }
       return wrapSelect(node);
     }
 
+    private boolean hasConflictTableAlias(SqlNode  node, @Nullable String 
neededAlias) {

Review Comment:
   Done. Thanks.



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

Reply via email to