Skip to content

Commit b126bca

Browse files
authored
Port tests in subqueries.rs to sqllogictest (#8231)
* Port tests in subqueries.rs to sqllogictest Signed-off-by: Chojan Shang <psiace@apache.org> * Follow rowsort Signed-off-by: Chojan Shang <psiace@apache.org> --------- Signed-off-by: Chojan Shang <psiace@apache.org>
1 parent 9fd0f4e commit b126bca

File tree

3 files changed

+24
-64
lines changed

3 files changed

+24
-64
lines changed

datafusion/core/tests/sql/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ pub mod references;
9292
pub mod repartition;
9393
pub mod select;
9494
mod sql_api;
95-
pub mod subqueries;
9695
pub mod timestamp;
9796

9897
fn create_join_context(

datafusion/core/tests/sql/subqueries.rs

Lines changed: 0 additions & 63 deletions
This file was deleted.

datafusion/sqllogictest/test_files/subquery.slt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,3 +988,27 @@ SELECT * FROM
988988
ON (severity.cron_job_name = jobs.cron_job_name);
989989
----
990990
catan-prod1-daily success catan-prod1-daily high
991+
992+
##correlated_scalar_subquery_sum_agg_bug
993+
#query TT
994+
#explain
995+
#select t1.t1_int from t1 where
996+
# (select sum(t2_int) is null from t2 where t1.t1_id = t2.t2_id)
997+
#----
998+
#logical_plan
999+
#Projection: t1.t1_int
1000+
#--Inner Join: t1.t1_id = __scalar_sq_1.t2_id
1001+
#----TableScan: t1 projection=[t1_id, t1_int]
1002+
#----SubqueryAlias: __scalar_sq_1
1003+
#------Projection: t2.t2_id
1004+
#--------Filter: SUM(t2.t2_int) IS NULL
1005+
#----------Aggregate: groupBy=[[t2.t2_id]], aggr=[[SUM(t2.t2_int)]]
1006+
#------------TableScan: t2 projection=[t2_id, t2_int]
1007+
1008+
#query I rowsort
1009+
#select t1.t1_int from t1 where
1010+
# (select sum(t2_int) is null from t2 where t1.t1_id = t2.t2_id)
1011+
#----
1012+
#2
1013+
#3
1014+
#4

0 commit comments

Comments
 (0)