Skip to content

Commit

Permalink
fix: correct count(*) alias (#7081)
Browse files Browse the repository at this point in the history
* remove count_wildcard_rule.rs column

* fix test

* fix ut

* fix avro

* fix tpch

* fix subquery
  • Loading branch information
jackwener authored Jul 30, 2023
1 parent 2427d3a commit 01d7dba
Show file tree
Hide file tree
Showing 21 changed files with 202 additions and 265 deletions.
10 changes: 5 additions & 5 deletions datafusion/core/src/execution/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2304,11 +2304,11 @@ mod tests {

assert_eq!(results.len(), 1);
let expected = vec![
"+--------------+--------------+-----------------+",
"| SUM(test.c1) | SUM(test.c2) | COUNT(UInt8(1)) |",
"+--------------+--------------+-----------------+",
"| 10 | 110 | 20 |",
"+--------------+--------------+-----------------+",
"+--------------+--------------+----------+",
"| SUM(test.c1) | SUM(test.c2) | COUNT(*) |",
"+--------------+--------------+----------+",
"| 10 | 110 | 20 |",
"+--------------+--------------+----------+",
];
assert_batches_eq!(expected, &results);

Expand Down
12 changes: 6 additions & 6 deletions datafusion/core/tests/path_partition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,12 @@ async fn csv_grouping_by_partition() -> Result<()> {
.await?;

let expected = vec![
"+------------+-----------------+----------------------+",
"| date | COUNT(UInt8(1)) | COUNT(DISTINCT t.c1) |",
"+------------+-----------------+----------------------+",
"| 2021-10-26 | 100 | 5 |",
"| 2021-10-27 | 100 | 5 |",
"+------------+-----------------+----------------------+",
"+------------+----------+----------------------+",
"| date | COUNT(*) | COUNT(DISTINCT t.c1) |",
"+------------+----------+----------------------+",
"| 2021-10-26 | 100 | 5 |",
"| 2021-10-27 | 100 | 5 |",
"+------------+----------+----------------------+",
];
assert_batches_sorted_eq!(expected, &result);

Expand Down
6 changes: 3 additions & 3 deletions datafusion/core/tests/sql/explain_analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ async fn explain_analyze_baseline_metrics() {
);
assert_metrics!(
&formatted,
"ProjectionExec: expr=[COUNT(UInt8(1))",
"ProjectionExec: expr=[COUNT(*)",
"metrics=[output_rows=1, elapsed_compute="
);
assert_metrics!(
Expand Down Expand Up @@ -695,7 +695,7 @@ async fn csv_explain_analyze() {
// Only test basic plumbing and try to avoid having to change too
// many things. explain_analyze_baseline_metrics covers the values
// in greater depth
let needle = "AggregateExec: mode=FinalPartitioned, gby=[c1@0 as c1], aggr=[COUNT(UInt8(1))], metrics=[output_rows=5";
let needle = "AggregateExec: mode=FinalPartitioned, gby=[c1@0 as c1], aggr=[COUNT(*)], metrics=[output_rows=5";
assert_contains!(&formatted, needle);

let verbose_needle = "Output Rows";
Expand Down Expand Up @@ -782,7 +782,7 @@ async fn explain_logical_plan_only() {
let expected = vec![
vec![
"logical_plan",
"Aggregate: groupBy=[[]], aggr=[[COUNT(UInt8(1))]]\
"Aggregate: groupBy=[[]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]\
\n SubqueryAlias: t\
\n Projection: column1\
\n Values: (Utf8(\"a\"), Int64(1), Int64(100)), (Utf8(\"a\"), Int64(2), Int64(150))"
Expand Down
10 changes: 5 additions & 5 deletions datafusion/core/tests/sql/references.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ async fn qualified_table_references() -> Result<()> {
let sql = format!("SELECT COUNT(*) FROM {table_ref}");
let actual = execute_to_batches(&ctx, &sql).await;
let expected = vec![
"+-----------------+",
"| COUNT(UInt8(1)) |",
"+-----------------+",
"| 100 |",
"+-----------------+",
"+----------+",
"| COUNT(*) |",
"+----------+",
"| 100 |",
"+----------+",
];
assert_batches_eq!(expected, &actual);
}
Expand Down
14 changes: 7 additions & 7 deletions datafusion/core/tests/sql/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,13 @@ async fn query_on_string_dictionary() -> Result<()> {
let sql = "SELECT d1, COUNT(*) FROM test group by d1";
let actual = execute_to_batches(&ctx, sql).await;
let expected = vec![
"+-------+-----------------+",
"| d1 | COUNT(UInt8(1)) |",
"+-------+-----------------+",
"| one | 1 |",
"| | 1 |",
"| three | 1 |",
"+-------+-----------------+",
"+-------+----------+",
"| d1 | COUNT(*) |",
"+-------+----------+",
"| | 1 |",
"| one | 1 |",
"| three | 1 |",
"+-------+----------+",
];
assert_batches_sorted_eq!(expected, &actual);

Expand Down
6 changes: 3 additions & 3 deletions datafusion/core/tests/sqllogictests/test_files/avro.slt
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ query TT
EXPLAIN SELECT count(*) from alltypes_plain
----
logical_plan
Aggregate: groupBy=[[]], aggr=[[COUNT(UInt8(1))]]
Aggregate: groupBy=[[]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
--TableScan: alltypes_plain projection=[id]
physical_plan
AggregateExec: mode=Final, gby=[], aggr=[COUNT(UInt8(1))]
AggregateExec: mode=Final, gby=[], aggr=[COUNT(*)]
--CoalescePartitionsExec
----AggregateExec: mode=Partial, gby=[], aggr=[COUNT(UInt8(1))]
----AggregateExec: mode=Partial, gby=[], aggr=[COUNT(*)]
------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1
--------AvroExec: file_groups={1 group: [[WORKSPACE_ROOT/testing/data/avro/alltypes_plain.avro]]}, projection=[id]
30 changes: 15 additions & 15 deletions datafusion/core/tests/sqllogictests/test_files/insert.slt

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions datafusion/core/tests/sqllogictests/test_files/joins.slt
Original file line number Diff line number Diff line change
Expand Up @@ -1329,15 +1329,15 @@ from (select * from join_t1 inner join join_t2 on join_t1.t1_id = join_t2.t2_id)
group by t1_id
----
logical_plan
Projection: COUNT(UInt8(1))
--Aggregate: groupBy=[[join_t1.t1_id]], aggr=[[COUNT(UInt8(1))]]
Projection: COUNT(*)
--Aggregate: groupBy=[[join_t1.t1_id]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
----Projection: join_t1.t1_id
------Inner Join: join_t1.t1_id = join_t2.t2_id
--------TableScan: join_t1 projection=[t1_id]
--------TableScan: join_t2 projection=[t2_id]
physical_plan
ProjectionExec: expr=[COUNT(UInt8(1))@1 as COUNT(UInt8(1))]
--AggregateExec: mode=SinglePartitioned, gby=[t1_id@0 as t1_id], aggr=[COUNT(UInt8(1))]
ProjectionExec: expr=[COUNT(*)@1 as COUNT(*)]
--AggregateExec: mode=SinglePartitioned, gby=[t1_id@0 as t1_id], aggr=[COUNT(*)]
----ProjectionExec: expr=[t1_id@0 as t1_id]
------CoalesceBatchesExec: target_batch_size=4096
--------HashJoinExec: mode=Partitioned, join_type=Inner, on=[(t1_id@0, t2_id@0)]
Expand Down
6 changes: 3 additions & 3 deletions datafusion/core/tests/sqllogictests/test_files/json.slt
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ query TT
EXPLAIN SELECT count(*) from json_test
----
logical_plan
Aggregate: groupBy=[[]], aggr=[[COUNT(UInt8(1))]]
Aggregate: groupBy=[[]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
--TableScan: json_test projection=[a]
physical_plan
AggregateExec: mode=Final, gby=[], aggr=[COUNT(UInt8(1))]
AggregateExec: mode=Final, gby=[], aggr=[COUNT(*)]
--CoalescePartitionsExec
----AggregateExec: mode=Partial, gby=[], aggr=[COUNT(UInt8(1))]
----AggregateExec: mode=Partial, gby=[], aggr=[COUNT(*)]
------RepartitionExec: partitioning=RoundRobinBatch(4), input_partitions=1
--------JsonExec: file_groups={1 group: [[WORKSPACE_ROOT/datafusion/core/tests/data/2.json]]}, projection=[a]

Expand Down
78 changes: 39 additions & 39 deletions datafusion/core/tests/sqllogictests/test_files/subquery.slt
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,9 @@ explain SELECT t1_id, t1_name FROM t1 WHERE EXISTS (SELECT count(*) FROM t2 WHER
logical_plan
Filter: EXISTS (<subquery>)
--Subquery:
----Projection: COUNT(UInt8(1))
----Projection: COUNT(*)
------Filter: SUM(outer_ref(t1.t1_int) + t2.t2_id) > Int64(0)
--------Aggregate: groupBy=[[]], aggr=[[COUNT(UInt8(1)), SUM(outer_ref(t1.t1_int) + t2.t2_id)]]
--------Aggregate: groupBy=[[]], aggr=[[COUNT(UInt8(1)) AS COUNT(*), SUM(outer_ref(t1.t1_int) + t2.t2_id)]]
----------Filter: outer_ref(t1.t1_name) = t2.t2_name
------------TableScan: t2
--TableScan: t1 projection=[t1_id, t1_name]
Expand Down Expand Up @@ -685,20 +685,20 @@ query TT
explain select (select count(*) from t1) as b
----
logical_plan
Projection: __scalar_sq_1.COUNT(UInt8(1)) AS b
Projection: __scalar_sq_1.COUNT(*) AS b
--SubqueryAlias: __scalar_sq_1
----Aggregate: groupBy=[[]], aggr=[[COUNT(UInt8(1))]]
----Aggregate: groupBy=[[]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
------TableScan: t1 projection=[t1_id]

#simple_uncorrelated_scalar_subquery2
query TT
explain select (select count(*) from t1) as b, (select count(1) from t2)
----
logical_plan
Projection: __scalar_sq_1.COUNT(UInt8(1)) AS b, __scalar_sq_2.COUNT(Int64(1)) AS COUNT(Int64(1))
Projection: __scalar_sq_1.COUNT(*) AS b, __scalar_sq_2.COUNT(Int64(1)) AS COUNT(Int64(1))
--Left Join:
----SubqueryAlias: __scalar_sq_1
------Aggregate: groupBy=[[]], aggr=[[COUNT(UInt8(1))]]
------Aggregate: groupBy=[[]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
--------TableScan: t1 projection=[t1_id]
----SubqueryAlias: __scalar_sq_2
------Aggregate: groupBy=[[]], aggr=[[COUNT(Int64(1))]]
Expand All @@ -714,12 +714,12 @@ 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, CASE WHEN __scalar_sq_1.__always_true IS NULL THEN Int64(0) ELSE __scalar_sq_1.COUNT(*) END 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, __always_true
--------Aggregate: groupBy=[[t2.t2_int, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
----------TableScan: t2 projection=[t2_int]

query II rowsort
Expand All @@ -736,12 +736,12 @@ query TT
explain SELECT t1_id, (SELECT count(*) FROM t2 WHERE t2.t2_int = t1.t1_int) as cnt 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 cnt
Projection: t1.t1_id, CASE WHEN __scalar_sq_1.__always_true IS NULL THEN Int64(0) ELSE __scalar_sq_1.COUNT(*) END AS cnt
--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, __always_true
--------Aggregate: groupBy=[[t2.t2_int, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
----------TableScan: t2 projection=[t2_int]

query II rowsort
Expand All @@ -761,8 +761,8 @@ Projection: t1.t1_id, CASE WHEN __scalar_sq_1.__always_true IS NULL THEN Int64(0
--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)) AS _cnt, t2.t2_int, __always_true
--------Aggregate: groupBy=[[t2.t2_int, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1))]]
------Projection: COUNT(*) AS _cnt, t2.t2_int, __always_true
--------Aggregate: groupBy=[[t2.t2_int, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
----------TableScan: t2 projection=[t2_int]

query II rowsort
Expand All @@ -782,8 +782,8 @@ Projection: t1.t1_id, CASE WHEN __scalar_sq_1.__always_true IS NULL THEN Int64(2
--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)) + Int64(2) AS _cnt, t2.t2_int, __always_true
--------Aggregate: groupBy=[[t2.t2_int, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1))]]
------Projection: COUNT(*) + Int64(2) AS _cnt, t2.t2_int, __always_true
--------Aggregate: groupBy=[[t2.t2_int, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
----------TableScan: t2 projection=[t2_int]

query II rowsort
Expand All @@ -800,13 +800,13 @@ explain select t1.t1_int from t1 where (select count(*) from t2 where t1.t1_id =
----
logical_plan
Projection: t1.t1_int
--Filter: CASE WHEN __scalar_sq_1.__always_true IS NULL THEN Int64(0) ELSE __scalar_sq_1.COUNT(UInt8(1)) END < CAST(t1.t1_int AS Int64)
----Projection: t1.t1_int, __scalar_sq_1.COUNT(UInt8(1)), __scalar_sq_1.__always_true
--Filter: CASE WHEN __scalar_sq_1.__always_true IS NULL THEN Int64(0) ELSE __scalar_sq_1.COUNT(*) END < CAST(t1.t1_int AS Int64)
----Projection: t1.t1_int, __scalar_sq_1.COUNT(*), __scalar_sq_1.__always_true
------Left Join: t1.t1_id = __scalar_sq_1.t2_id
--------TableScan: t1 projection=[t1_id, t1_int]
--------SubqueryAlias: __scalar_sq_1
----------Projection: COUNT(UInt8(1)), t2.t2_id, __always_true
------------Aggregate: groupBy=[[t2.t2_id, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1))]]
----------Projection: COUNT(*), t2.t2_id, __always_true
------------Aggregate: groupBy=[[t2.t2_id, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
--------------TableScan: t2 projection=[t2_id]

query I rowsort
Expand All @@ -826,10 +826,10 @@ Projection: t1.t1_id, __scalar_sq_1.cnt_plus_2 AS cnt_plus_2
--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)) + Int64(2) AS cnt_plus_2, t2.t2_int
--------Filter: COUNT(UInt8(1)) > Int64(1)
----------Projection: t2.t2_int, COUNT(UInt8(1))
------------Aggregate: groupBy=[[t2.t2_int, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1))]]
------Projection: COUNT(*) + Int64(2) AS cnt_plus_2, t2.t2_int
--------Filter: COUNT(*) > Int64(1)
----------Projection: t2.t2_int, COUNT(*)
------------Aggregate: groupBy=[[t2.t2_int, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
--------------TableScan: t2 projection=[t2_int]

query II rowsort
Expand All @@ -846,12 +846,12 @@ query TT
explain SELECT t1_id, (SELECT count(*) + 2 as cnt_plus_2 FROM t2 WHERE t2.t2_int = t1.t1_int having count(*) = 0) from t1
----
logical_plan
Projection: t1.t1_id, CASE WHEN __scalar_sq_1.__always_true IS NULL THEN Int64(2) AS cnt_plus_2 WHEN __scalar_sq_1.COUNT(UInt8(1)) != Int64(0) THEN NULL ELSE __scalar_sq_1.cnt_plus_2 END AS cnt_plus_2
Projection: t1.t1_id, CASE WHEN __scalar_sq_1.__always_true IS NULL THEN Int64(2) AS cnt_plus_2 WHEN __scalar_sq_1.COUNT(*) != Int64(0) THEN NULL ELSE __scalar_sq_1.cnt_plus_2 END AS cnt_plus_2
--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)) + Int64(2) AS cnt_plus_2, t2.t2_int, COUNT(UInt8(1)), __always_true
--------Aggregate: groupBy=[[t2.t2_int, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1))]]
------Projection: COUNT(*) + Int64(2) AS cnt_plus_2, t2.t2_int, COUNT(*), __always_true
--------Aggregate: groupBy=[[t2.t2_int, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
----------TableScan: t2 projection=[t2_int]

query II rowsort
Expand All @@ -868,14 +868,14 @@ explain select t1.t1_int from t1 group by t1.t1_int having (select count(*) from
----
logical_plan
Projection: t1.t1_int
--Filter: CASE WHEN __scalar_sq_1.__always_true IS NULL THEN Int64(0) ELSE __scalar_sq_1.COUNT(UInt8(1)) END = Int64(0)
----Projection: t1.t1_int, __scalar_sq_1.COUNT(UInt8(1)), __scalar_sq_1.__always_true
--Filter: CASE WHEN __scalar_sq_1.__always_true IS NULL THEN Int64(0) ELSE __scalar_sq_1.COUNT(*) END = Int64(0)
----Projection: t1.t1_int, __scalar_sq_1.COUNT(*), __scalar_sq_1.__always_true
------Left Join: t1.t1_int = __scalar_sq_1.t2_int
--------Aggregate: groupBy=[[t1.t1_int]], aggr=[[]]
----------TableScan: t1 projection=[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, __always_true
------------Aggregate: groupBy=[[t2.t2_int, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
--------------TableScan: t2 projection=[t2_int]

query I rowsort
Expand All @@ -895,8 +895,8 @@ Projection: t1.t1_int
------Left Join: t1.t1_int = __scalar_sq_1.t2_int
--------TableScan: t1 projection=[t1_int]
--------SubqueryAlias: __scalar_sq_1
----------Projection: COUNT(UInt8(1)) AS cnt, t2.t2_int, __always_true
------------Aggregate: groupBy=[[t2.t2_int, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1))]]
----------Projection: COUNT(*) AS cnt, t2.t2_int, __always_true
------------Aggregate: groupBy=[[t2.t2_int, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
--------------TableScan: t2 projection=[t2_int]


Expand All @@ -920,13 +920,13 @@ select t1.t1_int from t1 where (
----
logical_plan
Projection: t1.t1_int
--Filter: CASE WHEN __scalar_sq_1.__always_true IS NULL THEN Int64(2) WHEN __scalar_sq_1.COUNT(UInt8(1)) != Int64(0) THEN NULL ELSE __scalar_sq_1.cnt_plus_two END = Int64(2)
----Projection: t1.t1_int, __scalar_sq_1.cnt_plus_two, __scalar_sq_1.COUNT(UInt8(1)), __scalar_sq_1.__always_true
--Filter: CASE WHEN __scalar_sq_1.__always_true IS NULL THEN Int64(2) WHEN __scalar_sq_1.COUNT(*) != Int64(0) THEN NULL ELSE __scalar_sq_1.cnt_plus_two END = Int64(2)
----Projection: t1.t1_int, __scalar_sq_1.cnt_plus_two, __scalar_sq_1.COUNT(*), __scalar_sq_1.__always_true
------Left Join: t1.t1_int = __scalar_sq_1.t2_int
--------TableScan: t1 projection=[t1_int]
--------SubqueryAlias: __scalar_sq_1
----------Projection: COUNT(UInt8(1)) + Int64(1) + Int64(1) AS cnt_plus_two, t2.t2_int, COUNT(UInt8(1)), __always_true
------------Aggregate: groupBy=[[t2.t2_int, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1))]]
----------Projection: COUNT(*) + Int64(1) + Int64(1) AS cnt_plus_two, t2.t2_int, COUNT(*), __always_true
------------Aggregate: groupBy=[[t2.t2_int, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
--------------TableScan: t2 projection=[t2_int]

query I rowsort
Expand Down Expand Up @@ -954,8 +954,8 @@ Projection: t1.t1_int
------Left Join: t1.t1_int = __scalar_sq_1.t2_int
--------TableScan: t1 projection=[t1_int]
--------SubqueryAlias: __scalar_sq_1
----------Projection: CASE WHEN COUNT(UInt8(1)) = Int64(1) THEN Int64(NULL) ELSE COUNT(UInt8(1)) END AS cnt, t2.t2_int, __always_true
------------Aggregate: groupBy=[[t2.t2_int, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1))]]
----------Projection: CASE WHEN COUNT(*) = Int64(1) THEN Int64(NULL) ELSE COUNT(*) END AS cnt, t2.t2_int, __always_true
------------Aggregate: groupBy=[[t2.t2_int, Boolean(true) AS __always_true]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
--------------TableScan: t2 projection=[t2_int]


Expand Down
Loading

0 comments on commit 01d7dba

Please sign in to comment.