[SPARK-21645]left outer join synchronize the condition from left table to right #21161
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
JIRA Issue:https://issues.apache.org/jira/browse/SPARK-21645
Change the optimize rule of leftouter join, if the filter column is contained in join column, the can synchronize the filter from left to right, For example, left join sql:
Select * from a left outer join b on a.id=b.id where a.id=12345;
After join optimizer rule, the filter a.id = 12345 of table a should be synchronized to table b(b.id=12345)
How was this patch tested?
(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)
To see the query plan by explain the sql like 'Select * from a left outer join b on a.id=b.id where a.id=12345', guarantee the filter a.id=12345 is synchronized to table b.