Skip to content

Commit

Permalink
reflect the change to test strings, slt and md files
Browse files Browse the repository at this point in the history
  • Loading branch information
razeghi71 committed Dec 4, 2023
1 parent f5c6cf7 commit 2312e1f
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion datafusion/core/src/physical_planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2779,7 +2779,7 @@ mod tests {
digraph {
1[shape=box label="ProjectionExec: expr=[id@0 + 2 as employee.id + Int32(2)]", tooltip=""]
2[shape=box label="EmptyExec: produce_one_row=false", tooltip=""]
2[shape=box label="EmptyExec", tooltip=""]
1 -> 2 [arrowhead=none, arrowtail=normal, dir=back]
}
// End DataFusion GraphViz Plan
Expand Down
4 changes: 2 additions & 2 deletions datafusion/core/tests/sql/explain_analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ async fn explain_analyze_runs_optimizers() {

// This happens as an optimization pass where count(*) can be
// answered using statistics only.
let expected = "EmptyExec: produce_one_row=true";
let expected = "MemoryExec: partitions=1, partition_sizes=[1]";

let sql = "EXPLAIN SELECT count(*) from alltypes_plain";
let actual = execute_to_batches(&ctx, sql).await;
Expand Down Expand Up @@ -806,7 +806,7 @@ async fn explain_physical_plan_only() {
let expected = vec![vec![
"physical_plan",
"ProjectionExec: expr=[2 as COUNT(*)]\
\n EmptyExec: produce_one_row=true\
\n MemoryExec: partitions=1, partition_sizes=[1]\
\n",
]];
assert_eq!(expected, actual);
Expand Down
6 changes: 3 additions & 3 deletions datafusion/optimizer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Looking at the `EXPLAIN` output we can see that the optimizer has effectively re
| logical_plan | Projection: Int64(3) AS Int64(1) + Int64(2) |
| | EmptyRelation |
| physical_plan | ProjectionExec: expr=[3 as Int64(1) + Int64(2)] |
| | EmptyExec: produce_one_row=true |
| | MemoryExec: partitions=1, partition_sizes=[1] |
| | |
+---------------+-------------------------------------------------+
```
Expand Down Expand Up @@ -318,15 +318,15 @@ In the following example, the `type_coercion` and `simplify_expressions` passes
| logical_plan | Projection: Utf8("3.2") AS foo |
| | EmptyRelation |
| initial_physical_plan | ProjectionExec: expr=[3.2 as foo] |
| | EmptyExec: produce_one_row=true |
| | MemoryExec: partitions=1, partition_sizes=[1] |
| | |
| physical_plan after aggregate_statistics | SAME TEXT AS ABOVE |
| physical_plan after join_selection | SAME TEXT AS ABOVE |
| physical_plan after coalesce_batches | SAME TEXT AS ABOVE |
| physical_plan after repartition | SAME TEXT AS ABOVE |
| physical_plan after add_merge_exec | SAME TEXT AS ABOVE |
| physical_plan | ProjectionExec: expr=[3.2 as foo] |
| | EmptyExec: produce_one_row=true |
| | MemoryExec: partitions=1, partition_sizes=[1] |
| | |
+------------------------------------------------------------+---------------------------------------------------------------------------+
```
Expand Down
2 changes: 1 addition & 1 deletion datafusion/physical-plan/src/display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl<'a> DisplayableExecutionPlan<'a> {
/// ```dot
/// strict digraph dot_plan {
// 0[label="ProjectionExec: expr=[id@0 + 2 as employee.id + Int32(2)]",tooltip=""]
// 1[label="EmptyExec: produce_one_row=false",tooltip=""]
// 1[label="EmptyExec",tooltip=""]
// 0 -> 1
// }
/// ```
Expand Down
6 changes: 3 additions & 3 deletions datafusion/sqllogictest/test_files/explain.slt
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ EXPLAIN select count(*) from (values ('a', 1, 100), ('a', 2, 150)) as t (c1,c2,c
----
physical_plan
ProjectionExec: expr=[2 as COUNT(*)]
--EmptyExec: produce_one_row=true
--MemoryExec: partitions=1, partition_sizes=[1]

statement ok
set datafusion.explain.physical_plan_only = false
Expand Down Expand Up @@ -368,7 +368,7 @@ Projection: List([[1, 2, 3], [4, 5, 6]]) AS make_array(make_array(Int64(1),Int64
--EmptyRelation
physical_plan
ProjectionExec: expr=[[[1, 2, 3], [4, 5, 6]] as make_array(make_array(Int64(1),Int64(2),Int64(3)),make_array(Int64(4),Int64(5),Int64(6)))]
--EmptyExec: produce_one_row=true
--MemoryExec: partitions=1, partition_sizes=[1]

query TT
explain select [[1, 2, 3], [4, 5, 6]];
Expand All @@ -378,4 +378,4 @@ Projection: List([[1, 2, 3], [4, 5, 6]]) AS make_array(make_array(Int64(1),Int64
--EmptyRelation
physical_plan
ProjectionExec: expr=[[[1, 2, 3], [4, 5, 6]] as make_array(make_array(Int64(1),Int64(2),Int64(3)),make_array(Int64(4),Int64(5),Int64(6)))]
--EmptyExec: produce_one_row=true
--MemoryExec: partitions=1, partition_sizes=[1]
2 changes: 1 addition & 1 deletion datafusion/sqllogictest/test_files/join.slt
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ query TT
explain select * from t1 join t2 on false;
----
logical_plan EmptyRelation
physical_plan EmptyExec: produce_one_row=false
physical_plan EmptyExec

# Make batch size smaller than table row number. to introduce parallelism to the plan.
statement ok
Expand Down
6 changes: 3 additions & 3 deletions datafusion/sqllogictest/test_files/limit.slt
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ Aggregate: groupBy=[[]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
----TableScan: t1 projection=[], fetch=14
physical_plan
ProjectionExec: expr=[0 as COUNT(*)]
--EmptyExec: produce_one_row=true
--MemoryExec: partitions=1, partition_sizes=[1]

query I
SELECT COUNT(*) FROM (SELECT a FROM t1 LIMIT 3 OFFSET 11);
Expand All @@ -330,7 +330,7 @@ Aggregate: groupBy=[[]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
----TableScan: t1 projection=[], fetch=11
physical_plan
ProjectionExec: expr=[2 as COUNT(*)]
--EmptyExec: produce_one_row=true
--MemoryExec: partitions=1, partition_sizes=[1]

query I
SELECT COUNT(*) FROM (SELECT a FROM t1 LIMIT 3 OFFSET 8);
Expand All @@ -348,7 +348,7 @@ Aggregate: groupBy=[[]], aggr=[[COUNT(UInt8(1)) AS COUNT(*)]]
----TableScan: t1 projection=[]
physical_plan
ProjectionExec: expr=[2 as COUNT(*)]
--EmptyExec: produce_one_row=true
--MemoryExec: partitions=1, partition_sizes=[1]

query I
SELECT COUNT(*) FROM (SELECT a FROM t1 LIMIT 3 OFFSET 8);
Expand Down
10 changes: 5 additions & 5 deletions datafusion/sqllogictest/test_files/union.slt
Original file line number Diff line number Diff line change
Expand Up @@ -546,11 +546,11 @@ UnionExec
------CoalesceBatchesExec: target_batch_size=2
--------RepartitionExec: partitioning=Hash([Int64(1)@0], 4), input_partitions=1
----------AggregateExec: mode=Partial, gby=[1 as Int64(1)], aggr=[]
------------EmptyExec: produce_one_row=true
------------MemoryExec: partitions=1, partition_sizes=[1]
--ProjectionExec: expr=[2 as a]
----EmptyExec: produce_one_row=true
----MemoryExec: partitions=1, partition_sizes=[1]
--ProjectionExec: expr=[3 as a]
----EmptyExec: produce_one_row=true
----MemoryExec: partitions=1, partition_sizes=[1]

# test UNION ALL aliases correctly with aliased subquery
query TT
Expand Down Expand Up @@ -578,7 +578,7 @@ UnionExec
--------RepartitionExec: partitioning=Hash([n@0], 4), input_partitions=1
----------AggregateExec: mode=Partial, gby=[n@0 as n], aggr=[COUNT(*)]
------------ProjectionExec: expr=[5 as n]
--------------EmptyExec: produce_one_row=true
--------------MemoryExec: partitions=1, partition_sizes=[1]
--ProjectionExec: expr=[1 as count, MAX(Int64(10))@0 as n]
----AggregateExec: mode=Single, gby=[], aggr=[MAX(Int64(10))]
------EmptyExec: produce_one_row=true
------MemoryExec: partitions=1, partition_sizes=[1]
16 changes: 8 additions & 8 deletions datafusion/sqllogictest/test_files/window.slt
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,13 @@ SortPreservingMergeExec: [b@0 ASC NULLS LAST]
------------AggregateExec: mode=Partial, gby=[b@1 as b], aggr=[MAX(d.a)]
--------------UnionExec
----------------ProjectionExec: expr=[1 as a, aa as b]
------------------EmptyExec: produce_one_row=true
------------------MemoryExec: partitions=1, partition_sizes=[1]
----------------ProjectionExec: expr=[3 as a, aa as b]
------------------EmptyExec: produce_one_row=true
------------------MemoryExec: partitions=1, partition_sizes=[1]
----------------ProjectionExec: expr=[5 as a, bb as b]
------------------EmptyExec: produce_one_row=true
------------------MemoryExec: partitions=1, partition_sizes=[1]
----------------ProjectionExec: expr=[7 as a, bb as b]
------------------EmptyExec: produce_one_row=true
------------------MemoryExec: partitions=1, partition_sizes=[1]

# Check actual result:
query TI
Expand Down Expand Up @@ -365,13 +365,13 @@ SortPreservingMergeExec: [b@0 ASC NULLS LAST]
--------------RepartitionExec: partitioning=Hash([b@1], 4), input_partitions=4
----------------UnionExec
------------------ProjectionExec: expr=[1 as a, aa as b]
--------------------EmptyExec: produce_one_row=true
--------------------MemoryExec
------------------ProjectionExec: expr=[3 as a, aa as b]
--------------------EmptyExec: produce_one_row=true
--------------------MemoryExec
------------------ProjectionExec: expr=[5 as a, bb as b]
--------------------EmptyExec: produce_one_row=true
--------------------MemoryExec
------------------ProjectionExec: expr=[7 as a, bb as b]
--------------------EmptyExec: produce_one_row=true
--------------------MemoryExec


# check actual result
Expand Down

0 comments on commit 2312e1f

Please sign in to comment.