Fix planning bug while using sort merge frame processor#14450
Merged
LakshSingla merged 15 commits intoapache:masterfrom Jul 11, 2023
Merged
Fix planning bug while using sort merge frame processor#14450LakshSingla merged 15 commits intoapache:masterfrom
LakshSingla merged 15 commits intoapache:masterfrom
Conversation
Contributor
adarshsanjeev
left a comment
There was a problem hiding this comment.
The PR looks good % a few minor comments
...sions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/DataSourcePlan.java
Show resolved
Hide resolved
...sions-core/multi-stage-query/src/main/java/org/apache/druid/msq/querykit/DataSourcePlan.java
Outdated
Show resolved
Hide resolved
sql/src/test/java/org/apache/druid/sql/calcite/CalciteJoinQueryTest.java
Show resolved
Hide resolved
cryptoe
approved these changes
Jul 10, 2023
Contributor
cryptoe
left a comment
There was a problem hiding this comment.
Changes lgtm. @LakshSingla The CI failures look legit though.
adarshsanjeev
approved these changes
Jul 11, 2023
Contributor
Author
|
Thanks, fixed the test case that was throwing. |
Contributor
Author
|
Thanks @cryptoe @adarshsanjeev for the review |
LakshSingla
added a commit
to LakshSingla/druid
that referenced
this pull request
Jul 11, 2023
sqlJoinAlgorithm is now a hint to the planner to execute the join in the specified manner. The planner can decide to ignore the hint if it deduces that the specified algorithm can be detrimental to the performance of the join beforehand.
sergioferragut
pushed a commit
to sergioferragut/druid
that referenced
this pull request
Jul 21, 2023
sqlJoinAlgorithm is now a hint to the planner to execute the join in the specified manner. The planner can decide to ignore the hint if it deduces that the specified algorithm can be detrimental to the performance of the join beforehand.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Sort merge join plans the join queries in a different way where both the sides of the joins are subquery. This introduces a regression in planning when the condition for the join becomes an input ref to a boolean column indicating whether or not that row needs to be included or not. This PR fixes the following things:
The 2) point should ideally reside in the planner, however till the time we have a clean way to do so, we will do it in the MSQ's planner (QueryKit)
Release notes
sqlJoinAlgorithmis now a hint to the planner to execute the join in the specified manner. The planner can decide to ignore the hint if it deduces that the specified algorithm can be detrimental to the performance of the join beforehand.This PR has: