Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] refactor to simplify the judge bottom-join #52

Closed
jackwener opened this issue May 10, 2022 · 4 comments
Closed

[Enhancement] refactor to simplify the judge bottom-join #52

jackwener opened this issue May 10, 2022 · 4 comments

Comments

@jackwener
Copy link

https://github.com/ApsaraDB/galaxysql/blob/aa0b41ca6db291c0561089b5c25bd4171a969194/polardbx-calcite/src/main/java/org/apache/calcite/rel/rules/JoinCommuteRule.java#L190-L200

I think we don't need to judge it's bottom-join by using size() > 1.

Instead, we can just use left() instance of Join.

@jackwener
Copy link
Author

How do you think? @Oldbread3

@chenzl25
Copy link
Collaborator

I don't think so. In VolcanoPlanner, the input of this logicalJoin could be a RelSubset instead of a specific Join node.

@Oldbread3
Copy link
Collaborator

agree with @chenzl25 , join could be hidden under any relNode(Project, Grouping, .etc), so that we need MetadataQuery to traverse whole sub-plan.

@jackwener
Copy link
Author

I got it😀

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

No branches or pull requests

3 participants