Skip to content

Commit

Permalink
add count() from (unnest()) explain result
Browse files Browse the repository at this point in the history
  • Loading branch information
TCeason committed Mar 31, 2023
1 parent 58f902b commit 8d52530
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ use common_expression::Scalar;
use crate::optimizer::rule::Rule;
use crate::optimizer::rule::RuleID;
use crate::optimizer::rule::TransformResult;
use crate::optimizer::util::contaions_project_set;
use crate::optimizer::RelExpr;
use crate::optimizer::SExpr;
use crate::plans::Aggregate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,36 @@ select count() from (select unnest(id), c1 from fold_count)
----
4

query T
explain select count() from (select unnest(id), c1 from fold_count)
----
EvalScalar
├── expressions: [count() (#4)]
├── estimated rows: 1.00
└── AggregateFinal
├── group by: []
├── aggregate functions: [count()]
├── estimated rows: 1.00
└── AggregatePartial
├── group by: []
├── aggregate functions: [count()]
├── estimated rows: 1.00
└── EvalScalar
├── expressions: [get(unnest (#2))]
├── estimated rows: 1.00
└── ProjectSet
├── estimated rows: 1.00
├── set returning functions: unnest(CAST(fold_count.id (#0) AS Array(Int32 NULL)))
└── TableScan
├── table: default.db_02_0062.fold_count
├── read rows: 1
├── read bytes: 76
├── partitions total: 1
├── partitions scanned: 1
├── pruning stats: [segments: <range pruning: 1 to 1>, blocks: <range pruning: 1 to 1, bloom pruning: 0 to 0>]
├── push downs: [filters: [], limit: NONE]
└── estimated rows: 1.00

statement ok
drop table fold_count;

Expand Down

0 comments on commit 8d52530

Please sign in to comment.