https://github.com/apache/spark
Revision 182bc85f2db0b3268b9b93ff91210811b00e1636 authored by gatorsmile on 13 October 2018, 04:02:38 UTC, committed by gatorsmile on 13 October 2018, 04:03:20 UTC
## What changes were proposed in this pull request?
```Scala
    val df1 = Seq(("abc", 1), (null, 3)).toDF("col1", "col2")
    df1.write.mode(SaveMode.Overwrite).parquet("/tmp/test1")
    val df2 = spark.read.parquet("/tmp/test1")
    df2.filter("col1 = 'abc' OR (col1 != 'abc' AND col2 == 3)").show()
```

Before the PR, it returns both rows. After the fix, it returns `Row ("abc", 1))`. This is to fix the bug in NULL handling in BooleanSimplification. This is a bug introduced in Spark 1.6 release.

## How was this patch tested?
Added test cases

Closes #22702 from gatorsmile/fixBooleanSimplify2.

Authored-by: gatorsmile <gatorsmile@gmail.com>
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
(cherry picked from commit c9ba59d38e2be17b802156b49d374a726e66c6b9)
Signed-off-by: gatorsmile <gatorsmile@gmail.com>
1 parent 5324a85
History
Tip revision: 182bc85f2db0b3268b9b93ff91210811b00e1636 authored by gatorsmile on 13 October 2018, 04:02:38 UTC
[SPARK-25714] Fix Null Handling in the Optimizer rule BooleanSimplification
Tip revision: 182bc85

README.md

back to top