-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-26366][SQL] ReplaceExceptWithFilter should consider NULL as False #23315
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1656,6 +1656,19 @@ class DatasetSuite extends QueryTest with SharedSQLContext { | |
| checkAnswer(df.groupBy(col("a")).agg(first(col("b"))), | ||
| Seq(Row("0", BigDecimal.valueOf(0.1111)), Row("1", BigDecimal.valueOf(1.1111)))) | ||
| } | ||
|
|
||
| test("SPARK-26366: return nulls which are not filtered in except") { | ||
| val inputDF = sqlContext.createDataFrame( | ||
| sparkContext.parallelize(Seq(Row("0", "a"), Row("1", null))), | ||
| StructType(Seq( | ||
| StructField("a", StringType, nullable = true), | ||
| StructField("b", StringType, nullable = true)))) | ||
|
|
||
| val exceptDF = inputDF.filter( | ||
| col("a").isin(Seq("0"): _*) or col("b").isin()) | ||
|
||
|
|
||
| checkAnswer(inputDF.except(exceptDF), Seq(Row("1", null))) | ||
| } | ||
| } | ||
|
|
||
| case class TestDataUnion(x: Int, y: Int, z: Int) | ||
|
|
||
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.
Seq("0" -> "a", "1" -> null).toDF("a", "b")
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.
with your suggestion, the test passes always, even without the patch, because it adds extra projects for renaming the fields, so I cannot do this...