allisonwang-db commented on a change in pull request #33070:
URL: https://github.com/apache/spark/pull/33070#discussion_r660271014



##########
File path: sql/core/src/test/resources/sql-tests/inputs/join-lateral.sql
##########
@@ -83,8 +83,65 @@ SELECT * FROM t1 WHERE c1 = (SELECT MIN(a) FROM t2, LATERAL 
(SELECT c1 AS a));
 -- lateral join inside correlated subquery
 SELECT * FROM t1 WHERE c1 = (SELECT MIN(a) FROM t2, LATERAL (SELECT c1 AS a) 
WHERE c1 = t1.c1);
 
--- TODO(SPARK-35551): handle the COUNT bug (the expected result should be (1, 
2, 0))
-SELECT * FROM t1, LATERAL (SELECT COUNT(*) AS cnt FROM t2 WHERE c1 = t1.c1) 
WHERE cnt = 0;
+-- COUNT bug with a single aggregate expression
+SELECT * FROM t1, LATERAL (SELECT COUNT(*) cnt FROM t2 WHERE c1 = t1.c1);
+
+-- COUNT bug with multiple aggregate expressions
+SELECT * FROM t1, LATERAL (SELECT COUNT(*) cnt, SUM(c2) sum FROM t2 WHERE c1 = 
t1.c1);
+
+-- COUNT bug without count aggregate
+SELECT * FROM t1, LATERAL (SELECT SUM(c2) IS NULL FROM t2 WHERE t1.c1 = t2.c1);

Review comment:
       Yes, `sum(c2) is null` should return `true` instead `null` in this case.
   
https://github.com/apache/spark/blob/880bbd6aaaead2ed26dfad38425f4e7357769b6a/sql/core/src/test/scala/org/apache/spark/sql/SubquerySuite.scala#L582-L586




-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to