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

Fix correctness issue with CASE WHEN with expressions that have side-effects #4383

Merged
merged 22 commits into from
Jan 6, 2022

Conversation

andygrove
Copy link
Contributor

@andygrove andygrove commented Dec 17, 2021

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

Closes #3849

Detect when a CASE WHEN has expressions that have side-effects and only evaluate them for the relevant rows. This follows on from similar work in #4358 for IF ELSE expressions.

There are optimizations to stop evaluating branches if every row has already caused a previous branch predicate to evaluate to true. The scala tests hit these cases and I tested manually by adding debug logging to confirm that the optimizations took effect.

@andygrove andygrove added this to the Dec 13 - Jan 7 milestone Dec 17, 2021
@andygrove andygrove self-assigned this Dec 17, 2021
@andygrove
Copy link
Contributor Author

build

Signed-off-by: Andy Grove <andygrove@nvidia.com>
…cumulativePred is true

Signed-off-by: Andy Grove <andygrove@nvidia.com>
@andygrove andygrove changed the title WIP: Fix correctness issue with CASE WHEN with expressions that have side-effects Fix correctness issue with CASE WHEN with expressions that have side-effects Dec 21, 2021
@andygrove andygrove marked this pull request as ready for review December 21, 2021 16:36
@sameerz sameerz added the bug Something isn't working label Dec 29, 2021
@jlowe
Copy link
Member

jlowe commented Jan 6, 2022

build

@andygrove andygrove merged commit ee162b5 into NVIDIA:branch-22.02 Jan 6, 2022
@andygrove andygrove deleted the gpu-case-when-side-effect branch January 6, 2022 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] In ANSI mode we can fail in cases Spark would not due to conditionals
3 participants