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

[SPARK-25402][SQL][BACKPORT-2.2] Null handling in BooleanSimplification #22403

Closed
wants to merge 2 commits into from

Conversation

gatorsmile
Copy link
Member

What changes were proposed in this pull request?

This PR is to fix the null handling in BooleanSimplification. In the rule BooleanSimplification, there are two cases that do not properly handle null values. The optimization is not right if either side is null. This PR is to fix them.

How was this patch tested?

Added test cases

This PR is to fix the null handling in BooleanSimplification. In the rule BooleanSimplification, there are two cases that do not properly handle null values. The optimization is not right if either side is null. This PR is to fix them.

Added test cases

Closes apache#22390 from gatorsmile/fixBooleanSimplification.

Authored-by: gatorsmile <gatorsmile@gmail.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
(cherry picked from commit 79cc597)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
dongjoon-hyun
dongjoon-hyun approved these changes Sep 12, 2018
@SparkQA
Copy link

SparkQA commented Sep 12, 2018

Test build #95999 has finished for PR 22403 at commit 7088371.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@@ -37,6 +38,7 @@ class BooleanSimplificationSuite extends PlanTest with PredicateHelper {
Batch("Constant Folding", FixedPoint(50),
NullPropagation(conf),
ConstantFolding,
SimplifyConditionals,
BooleanSimplification,
PruneFilters(conf)) :: Nil
}
Copy link
Member

@dongjoon-hyun dongjoon-hyun Sep 12, 2018

Choose a reason for hiding this comment

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

At line 46, SPARK-17851 changed like the following. We need that change. After updating that, it passes the test without any problems.

- val testRelation = LocalRelation('a.int, 'b.int, 'c.int, 'd.string)
+ val testRelation = LocalRelation('a.int, 'b.int, 'c.int, 'd.string,
   'e.boolean, 'f.boolean, 'g.boolean, 'h.boolean)

Copy link
Member Author

Choose a reason for hiding this comment

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

I see. Thanks!

@SparkQA
Copy link

SparkQA commented Sep 13, 2018

Test build #96033 has finished for PR 22403 at commit ec43727.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

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

+1, LGTM.

@dongjoon-hyun
Copy link
Member

Merged to branch-2.2.

asfgit pushed a commit that referenced this pull request Sep 13, 2018
## What changes were proposed in this pull request?
This PR is to fix the null handling in BooleanSimplification. In the rule BooleanSimplification, there are two cases that do not properly handle null values. The optimization is not right if either side is null. This PR is to fix them.

## How was this patch tested?
Added test cases

Closes #22403 from gatorsmile/backportSpark25402.

Authored-by: gatorsmile <gatorsmile@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
@gatorsmile gatorsmile closed this Sep 13, 2018
Willymontaz pushed a commit to criteo-forks/spark that referenced this pull request Sep 26, 2019
## What changes were proposed in this pull request?
This PR is to fix the null handling in BooleanSimplification. In the rule BooleanSimplification, there are two cases that do not properly handle null values. The optimization is not right if either side is null. This PR is to fix them.

## How was this patch tested?
Added test cases

Closes apache#22403 from gatorsmile/backportSpark25402.

Authored-by: gatorsmile <gatorsmile@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Willymontaz pushed a commit to criteo-forks/spark that referenced this pull request Sep 27, 2019
## What changes were proposed in this pull request?
This PR is to fix the null handling in BooleanSimplification. In the rule BooleanSimplification, there are two cases that do not properly handle null values. The optimization is not right if either side is null. This PR is to fix them.

## How was this patch tested?
Added test cases

Closes apache#22403 from gatorsmile/backportSpark25402.

Authored-by: gatorsmile <gatorsmile@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants