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

fixUpJoinConsistency rule now works when AQE is enabled #676

Merged
merged 5 commits into from
Sep 8, 2020

Conversation

andygrove
Copy link
Contributor

GpuOverrides applies a fixUpJoinConsistency rule to ensure that the inputs to a SortMergeJoin or ShuffledHashJoin are either both on CPU, or both on GPU. We can't support a mix of CPU and GPU because the hashing algorithms are not compatible, and therefore the join would produce incorrect results.

This PR adds a unit test for this rule, and also ensures that the rule is applied when AQE is enabled.

This closes #631

Signed-off-by: Andy Grove <andygrove@nvidia.com>
Signed-off-by: Andy Grove <andygrove@nvidia.com>
@andygrove andygrove added this to the Aug 31 - Sep 11 milestone Sep 6, 2020
@andygrove andygrove self-assigned this Sep 6, 2020
@andygrove andygrove changed the title [WIP] fixUpJoinConsistency rule now works when AQE is enabled fixUpJoinConsistency rule now works when AQE is enabled Sep 6, 2020
@andygrove andygrove mentioned this pull request Sep 6, 2020
@andygrove andygrove changed the title fixUpJoinConsistency rule now works when AQE is enabled [WIP] fixUpJoinConsistency rule now works when AQE is enabled Sep 6, 2020
Signed-off-by: Andy Grove <andygrove@nvidia.com>
@andygrove andygrove changed the title [WIP] fixUpJoinConsistency rule now works when AQE is enabled fixUpJoinConsistency rule now works when AQE is enabled Sep 6, 2020
Copy link
Collaborator

@abellina abellina left a comment

Choose a reason for hiding this comment

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

Just had one question

// since they already started to execute
// since they already started to execute, but we verify that they are both on CPU or
// both on GPU
if (queryStages.map(isGpuQueryStage).distinct.size == 2) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

so for my edification, we can't get in this situation unless there is a bug, or perhaps a change in behavior from AQE rules proper?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we could only get here due to a bug when planning query stages.

Signed-off-by: Andy Grove <andygrove@nvidia.com>
@andygrove
Copy link
Contributor Author

build

Signed-off-by: Andy Grove <andygrove@nvidia.com>
@sameerz sameerz added the test Only impacts tests label Sep 8, 2020
@andygrove
Copy link
Contributor Author

build

@andygrove
Copy link
Contributor Author

@abellina I was able to greatly simplify the logic in this PR. Please take a look when you can.

@andygrove andygrove added the bug Something isn't working label Sep 8, 2020
@andygrove andygrove merged commit 221e1c5 into NVIDIA:branch-0.2 Sep 8, 2020
@andygrove andygrove deleted the fix-up-joins branch September 8, 2020 18:56
nartal1 pushed a commit to nartal1/spark-rapids that referenced this pull request Jun 9, 2021
* fixUpJoinConsistency rule now works with AQE

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* Add comma to error message

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* Improved validation checks and error messages

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* bug fix: walk tree once to find shuffle exchanges and query stages

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* code simplification

Signed-off-by: Andy Grove <andygrove@nvidia.com>
nartal1 pushed a commit to nartal1/spark-rapids that referenced this pull request Jun 9, 2021
* fixUpJoinConsistency rule now works with AQE

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* Add comma to error message

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* Improved validation checks and error messages

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* bug fix: walk tree once to find shuffle exchanges and query stages

Signed-off-by: Andy Grove <andygrove@nvidia.com>

* code simplification

Signed-off-by: Andy Grove <andygrove@nvidia.com>
tgravescs pushed a commit to tgravescs/spark-rapids that referenced this pull request Nov 30, 2023
* first pass at a benchmark. Float only for now.

* signoff

Signed-off-by: Mike Wilson <knobby@burntsheep.com>

Signed-off-by: Mike Wilson <knobby@burntsheep.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working test Only impacts tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Rows are dropped when AQE is enabled in some cases
4 participants