xiedeyantu commented on code in PR #4748:
URL: https://github.com/apache/calcite/pull/4748#discussion_r2696274824
##########
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)) {
return wrapSelect(asFrom());
}
return wrapSelect(node);
}
+ private boolean hasConflictTableAlias(SqlNode node) {
+ if (!(node instanceof SqlIdentifier)) {
+ return false;
+ }
+ if (correlTableMap.isEmpty()) {
Review Comment:
This is also the question I wanted to ask: will fixing this location solve
all scenarios? But finding out is indeed a bit difficult.
--
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]