Skip to content

[CALCITE-5168] Allow AS after parenthesized JOIN - #5193

Open
xuzifu666 wants to merge 2 commits into
apache:mainfrom
xuzifu666:calcite-5168
Open

[CALCITE-5168] Allow AS after parenthesized JOIN#5193
xuzifu666 wants to merge 2 commits into
apache:mainfrom
xuzifu666:calcite-5168

Conversation

@xuzifu666

Copy link
Copy Markdown
Member

!ok

# [CALCITE-5168] Allow AS after parenthesized JOIN
select d.dname, j.empno, j.ename

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sql programe was validated in postgresql: https://onecompiler.com/postgresql/44ypqwt2u

@sonarqubecloud

Copy link
Copy Markdown

// 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest removing the last sentence. It works, fine, we don't know when it was introduced.

// 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 =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is subtle, but the tests pass, so I hope it's right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants