[CALCITE-5168] Allow AS after parenthesized JOIN - #5193
Conversation
| !ok | ||
|
|
||
| # [CALCITE-5168] Allow AS after parenthesized JOIN | ||
| select d.dname, j.empno, j.ename |
There was a problem hiding this comment.
This sql programe was validated in postgresql: https://onecompiler.com/postgresql/44ypqwt2u
| // not unique. TODO: Support this behavior; see | ||
| // [CALCITE-5168] Allow AS after parenthesized JOIN | ||
| checkNotJoin(tableRef); | ||
| // not unique. See [CALCITE-5168] Allow AS after parenthesized JOIN. |
There was a problem hiding this comment.
I would suggest removing the last sentence. It works, fine, we don't know when it was introduced.
There was a problem hiding this comment.
You are right, it is not need to introduce, I had removed it.
| // For an aliased join, the join's children must not be visible outside | ||
| // the alias. Prevent JoinScope.addChild from propagating children to | ||
| // the using scope by using parentScope. | ||
| final SqlValidatorScope exprUsingScope = |
There was a problem hiding this comment.
this is subtle, but the tests pass, so I hope it's right
There was a problem hiding this comment.
Thanks, agreed this is subtle. The intent is to prevent the children of an aliased join from leaking into the outer scope; the new validator tests cover that emp/bonus are no longer visible once the join is aliased as x.
|
0fb4111 to
e950a50
Compare



jira: https://issues.apache.org/jira/browse/CALCITE-5168