cxzl25 commented on code in PR #1866:
URL: https://github.com/apache/auron/pull/1866#discussion_r2677039113
##########
spark-extension-shims-spark/src/test/scala/org/apache/auron/AuronQuerySuite.scala:
##########
@@ -581,4 +581,85 @@ class AuronQuerySuite extends AuronQueryTest with
BaseAuronSQLSuite with AuronSQ
}
}
}
+
+ test("standard LEFT ANTI JOIN includes NULL keys") {
+ // This test verifies that standard LEFT ANTI JOIN correctly includes NULL
keys
+ // NULL keys should be in the result because NULL never matches anything
+ withTable("left_table", "right_table") {
+ sql("""
+ |CREATE TABLE left_table using parquet AS
+ |SELECT * FROM VALUES
+ | (1, 2.0),
+ | (1, 2.0),
+ | (2, 1.0),
+ | (2, 1.0),
+ | (3, 3.0),
+ | (null, null),
+ | (null, 5.0),
+ | (6, null)
+ |AS t(a, b)
+ |""".stripMargin)
+
+ sql("""
+ |CREATE TABLE right_table using parquet AS
+ |SELECT * FROM VALUES
+ | (2, 3.0),
+ | (2, 3.0),
+ | (3, 2.0),
+ | (4, 1.0),
+ | (null, null),
+ | (null, 5.0),
+ | (6, null)
+ |AS t(c, d)
+ |""".stripMargin)
+
+ // Standard LEFT ANTI JOIN should include rows with NULL keys
+ // Expected: (1, 2.0), (1, 2.0), (null, null), (null, 5.0)
+ checkSparkAnswer(
+ "SELECT * FROM left_table LEFT ANTI JOIN right_table ON left_table.a =
right_table.c")
+ }
+ }
+
+ test("left join with NOT IN subquery should filter NULL values") {
Review Comment:
```
== Results ==
!== Correct Answer - 1 == == Spark Answer - 1 ==
struct<cnt:bigint> struct<cnt:bigint>
![9] [99999] (QueryTest.scala:243)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]