-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-7871][SQL]Improve the outputPartitioning for HashOuterJoin #6413
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
Closed
Closed
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
85b8f75
Improve the outputPartitioning for HashOuterJoin
chenghao-intel 491a890
optimize for full outer join
chenghao-intel 61a8936
scalastyle
chenghao-intel ee5b991
refactor the exchange to support null clustering key as the optimization
chenghao-intel 42928e9
remove the AllTuples
chenghao-intel 2f1e9e4
Add more unit test
chenghao-intel c61b157
Add comment for unit test
chenghao-intel de9cde0
fix bug for the empty clustering key
chenghao-intel bd37778
Add more comment
chenghao-intel bd4541d
scalastyle
chenghao-intel fcb9aed
Fix bug in GeneratedAggregate
chenghao-intel ec4e5c2
update the unit test as the default value changed
chenghao-intel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
optimize for full outer join
- Loading branch information
commit 491a89042c41058653e9b41297c14bb1da856f4d
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,26 @@ import org.apache.spark.sql.{Row, SQLConf, execution} | |
|
|
||
|
|
||
| class PlannerSuite extends SparkFunSuite { | ||
| test("multiway full outer join") { | ||
| val planned = testData | ||
| .join(testData2, testData("key") === testData2("a"), "outer") | ||
| .join(testData3, testData("key") === testData3("a"), "outer") | ||
| .queryExecution.executedPlan | ||
| val exchanges = planned.collect { case n: Exchange => n } | ||
|
|
||
| assert(exchanges.size === 3) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is these changs doesn't effect to testData
.join(testData2, testData("key") === testData2("a"), "outer")
.join(testData2, testData("a") === testData3("a"), "outer")?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This requires some further change I think, @yhuai should have some idea on this. |
||
| } | ||
|
|
||
| test("full outer join followed by aggregation") { | ||
| val planned = testData | ||
| .join(testData2, testData("key") === testData2("a"), "outer") // join key testData('key) | ||
| .groupBy(testData("key")).agg(testData("key"), count("a")) // group by key testData('key) | ||
| .queryExecution.executedPlan | ||
| val exchanges = planned.collect { case n: Exchange => n } | ||
|
|
||
| assert(exchanges.size === 3) | ||
| } | ||
|
|
||
| test("unions are collapsed") { | ||
| val query = testData.unionAll(testData).unionAll(testData).logicalPlan | ||
| val planned = BasicOperators(query).head | ||
|
|
||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here
valuesmeans the original value of the table or the intermediate value of the join?is the
nullin original data of table also considered as invalid?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be the input value. (Either the original data from table or the intermediate result(e.g. join outputs)).
Validity of the null in the original table, depends on the semantics, in
Join, it's should also be invalid, but it's valid forGroup BY.It would an other optimization for repartition, contains
nullin the join keys.