jackwener commented on code in PR #7081:
URL: https://github.com/apache/arrow-datafusion/pull/7081#discussion_r1275824569


##########
datafusion/core/tests/sqllogictests/test_files/subquery.slt:
##########
@@ -714,106 +714,103 @@ query TT
 explain SELECT t1_id, (SELECT count(*) FROM t2 WHERE t2.t2_int = t1.t1_int) 
from t1
 ----
 logical_plan
-Projection: t1.t1_id, CASE WHEN __scalar_sq_1.__always_true IS NULL THEN 
Int64(0) ELSE __scalar_sq_1.COUNT(UInt8(1)) END AS COUNT(UInt8(1))
+Projection: t1.t1_id, __scalar_sq_1.COUNT(*) AS COUNT(*)
 --Left Join: t1.t1_int = __scalar_sq_1.t2_int
 ----TableScan: t1 projection=[t1_id, t1_int]
 ----SubqueryAlias: __scalar_sq_1
-------Projection: COUNT(UInt8(1)), t2.t2_int, __always_true
---------Aggregate: groupBy=[[t2.t2_int, Boolean(true) AS __always_true]], 
aggr=[[COUNT(UInt8(1))]]
+------Projection: COUNT(*), t2.t2_int
+--------Aggregate: groupBy=[[t2.t2_int]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
 ----------TableScan: t2 projection=[t2_int]
 
 query II rowsort
 SELECT t1_id, (SELECT count(*) FROM t2 WHERE t2.t2_int = t1.t1_int) from t1
 ----
 11 1
-22 0
+22 NULL

Review Comment:
   I will look these code carefully at weekend, thanks @alamb



-- 
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]

Reply via email to