Skip to content

Commit c5df6ee

Browse files
fix: remove trailing whitespace in Display for LogicalPlan::Projection (#16164)
1 parent 605ccbd commit c5df6ee

File tree

12 files changed

+24
-24
lines changed

12 files changed

+24
-24
lines changed

datafusion/core/tests/sql/explain_analyze.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ async fn explain_logical_plan_only() {
784784
vec!["logical_plan", "Projection: count(Int64(1)) AS count(*)\
785785
\n Aggregate: groupBy=[[]], aggr=[[count(Int64(1))]]\
786786
\n SubqueryAlias: t\
787-
\n Projection: \
787+
\n Projection:\
788788
\n Values: (Utf8(\"a\"), Int64(1), Int64(100)), (Utf8(\"a\"), Int64(2), Int64(150))"]];
789789
assert_eq!(expected, actual);
790790
}

datafusion/expr/src/logical_plan/plan.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,12 +1815,12 @@ impl LogicalPlan {
18151815
Ok(())
18161816
}
18171817
LogicalPlan::Projection(Projection { ref expr, .. }) => {
1818-
write!(f, "Projection: ")?;
1818+
write!(f, "Projection:")?;
18191819
for (i, expr_item) in expr.iter().enumerate() {
18201820
if i > 0 {
1821-
write!(f, ", ")?;
1821+
write!(f, ",")?;
18221822
}
1823-
write!(f, "{expr_item}")?;
1823+
write!(f, " {expr_item}")?;
18241824
}
18251825
Ok(())
18261826
}

datafusion/optimizer/src/optimize_projections/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ mod tests {
11241124
plan,
11251125
@r"
11261126
Aggregate: groupBy=[[]], aggr=[[count(Int32(1))]]
1127-
Projection:
1127+
Projection:
11281128
Aggregate: groupBy=[[]], aggr=[[count(Int32(1))]]
11291129
TableScan: ?table? projection=[]
11301130
"

datafusion/optimizer/tests/optimizer_integration.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ fn between_date32_plus_interval() -> Result<()> {
250250
format!("{plan}"),
251251
@r#"
252252
Aggregate: groupBy=[[]], aggr=[[count(Int64(1))]]
253-
Projection:
253+
Projection:
254254
Filter: test.col_date32 >= Date32("1998-03-18") AND test.col_date32 <= Date32("1998-06-16")
255255
TableScan: test projection=[col_date32]
256256
"#
@@ -268,7 +268,7 @@ fn between_date64_plus_interval() -> Result<()> {
268268
format!("{plan}"),
269269
@r#"
270270
Aggregate: groupBy=[[]], aggr=[[count(Int64(1))]]
271-
Projection:
271+
Projection:
272272
Filter: test.col_date64 >= Date64("1998-03-18") AND test.col_date64 <= Date64("1998-06-16")
273273
TableScan: test projection=[col_date64]
274274
"#

datafusion/sqllogictest/test_files/array.slt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6022,7 +6022,7 @@ logical_plan
60226022
02)--Aggregate: groupBy=[[]], aggr=[[count(Int64(1))]]
60236023
03)----SubqueryAlias: test
60246024
04)------SubqueryAlias: t
6025-
05)--------Projection:
6025+
05)--------Projection:
60266026
06)----------Filter: substr(CAST(md5(CAST(tmp_table.value AS Utf8)) AS Utf8), Int64(1), Int64(32)) IN ([Utf8View("7f4b18de3cfeb9b4ac78c381ee2ad278"), Utf8View("a"), Utf8View("b"), Utf8View("c")])
60276027
07)------------TableScan: tmp_table projection=[value]
60286028
physical_plan
@@ -6051,7 +6051,7 @@ logical_plan
60516051
02)--Aggregate: groupBy=[[]], aggr=[[count(Int64(1))]]
60526052
03)----SubqueryAlias: test
60536053
04)------SubqueryAlias: t
6054-
05)--------Projection:
6054+
05)--------Projection:
60556055
06)----------Filter: substr(CAST(md5(CAST(tmp_table.value AS Utf8)) AS Utf8), Int64(1), Int64(32)) IN ([Utf8View("7f4b18de3cfeb9b4ac78c381ee2ad278"), Utf8View("a"), Utf8View("b"), Utf8View("c")])
60566056
07)------------TableScan: tmp_table projection=[value]
60576057
physical_plan
@@ -6080,7 +6080,7 @@ logical_plan
60806080
02)--Aggregate: groupBy=[[]], aggr=[[count(Int64(1))]]
60816081
03)----SubqueryAlias: test
60826082
04)------SubqueryAlias: t
6083-
05)--------Projection:
6083+
05)--------Projection:
60846084
06)----------Filter: substr(CAST(md5(CAST(tmp_table.value AS Utf8)) AS Utf8), Int64(1), Int64(32)) IN ([Utf8View("7f4b18de3cfeb9b4ac78c381ee2ad278"), Utf8View("a"), Utf8View("b"), Utf8View("c")])
60856085
07)------------TableScan: tmp_table projection=[value]
60866086
physical_plan
@@ -6111,7 +6111,7 @@ logical_plan
61116111
02)--Aggregate: groupBy=[[]], aggr=[[count(Int64(1))]]
61126112
03)----SubqueryAlias: test
61136113
04)------SubqueryAlias: t
6114-
05)--------Projection:
6114+
05)--------Projection:
61156115
06)----------Filter: array_has(LargeList([7f4b18de3cfeb9b4ac78c381ee2ad278, a, b, c]), substr(CAST(md5(CAST(tmp_table.value AS Utf8)) AS Utf8), Int64(1), Int64(32)))
61166116
07)------------TableScan: tmp_table projection=[value]
61176117
physical_plan
@@ -6140,7 +6140,7 @@ logical_plan
61406140
02)--Aggregate: groupBy=[[]], aggr=[[count(Int64(1))]]
61416141
03)----SubqueryAlias: test
61426142
04)------SubqueryAlias: t
6143-
05)--------Projection:
6143+
05)--------Projection:
61446144
06)----------Filter: substr(CAST(md5(CAST(tmp_table.value AS Utf8)) AS Utf8), Int64(1), Int64(32)) IN ([Utf8View("7f4b18de3cfeb9b4ac78c381ee2ad278"), Utf8View("a"), Utf8View("b"), Utf8View("c")])
61456145
07)------------TableScan: tmp_table projection=[value]
61466146
physical_plan
@@ -6171,7 +6171,7 @@ logical_plan
61716171
02)--Aggregate: groupBy=[[]], aggr=[[count(Int64(1))]]
61726172
03)----SubqueryAlias: test
61736173
04)------SubqueryAlias: t
6174-
05)--------Projection:
6174+
05)--------Projection:
61756175
06)----------Filter: substr(CAST(md5(CAST(tmp_table.value AS Utf8)) AS Utf8), Int64(1), Int64(32)) IS NOT NULL OR Boolean(NULL)
61766176
07)------------TableScan: tmp_table projection=[value]
61776177
physical_plan

datafusion/sqllogictest/test_files/explain.slt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ logical_plan
420420
01)LeftSemi Join:
421421
02)--TableScan: t1 projection=[a]
422422
03)--SubqueryAlias: __correlated_sq_1
423-
04)----Projection:
423+
04)----Projection:
424424
05)------Aggregate: groupBy=[[]], aggr=[[count(Int64(1))]]
425425
06)--------TableScan: t2 projection=[]
426426
physical_plan

datafusion/sqllogictest/test_files/joins.slt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4385,7 +4385,7 @@ JOIN my_catalog.my_schema.table_with_many_types AS r ON l.binary_col = r.binary_
43854385
logical_plan
43864386
01)Projection: count(Int64(1)) AS count(*)
43874387
02)--Aggregate: groupBy=[[]], aggr=[[count(Int64(1))]]
4388-
03)----Projection:
4388+
03)----Projection:
43894389
04)------Inner Join: l.binary_col = r.binary_col
43904390
05)--------SubqueryAlias: l
43914391
06)----------TableScan: my_catalog.my_schema.table_with_many_types projection=[binary_col]

datafusion/sqllogictest/test_files/limit.slt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ EXPLAIN SELECT COUNT(*) FROM (SELECT a FROM t1 WHERE a > 3 LIMIT 3 OFFSET 6);
365365
logical_plan
366366
01)Projection: count(Int64(1)) AS count(*)
367367
02)--Aggregate: groupBy=[[]], aggr=[[count(Int64(1))]]
368-
03)----Projection:
368+
03)----Projection:
369369
04)------Limit: skip=6, fetch=3
370370
05)--------Filter: t1.a > Int32(3)
371371
06)----------TableScan: t1 projection=[a]

datafusion/sqllogictest/test_files/subquery.slt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ logical_plan
400400
01)LeftSemi Join:
401401
02)--TableScan: t1 projection=[t1_id, t1_name, t1_int]
402402
03)--SubqueryAlias: __correlated_sq_1
403-
04)----Projection:
403+
04)----Projection:
404404
05)------Filter: t1.t1_int < t1.t1_id
405405
06)--------TableScan: t1 projection=[t1_id, t1_int]
406406

@@ -1453,7 +1453,7 @@ logical_plan
14531453
01)LeftSemi Join:
14541454
02)--TableScan: t1 projection=[a]
14551455
03)--SubqueryAlias: __correlated_sq_1
1456-
04)----Projection:
1456+
04)----Projection:
14571457
05)------Aggregate: groupBy=[[]], aggr=[[count(Int64(1))]]
14581458
06)--------TableScan: t2 projection=[]
14591459

datafusion/sqllogictest/test_files/union.slt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ logical_plan
489489
04)------Limit: skip=0, fetch=3
490490
05)--------Aggregate: groupBy=[[]], aggr=[[count(Int64(1))]]
491491
06)----------SubqueryAlias: a
492-
07)------------Projection:
492+
07)------------Projection:
493493
08)--------------Aggregate: groupBy=[[aggregate_test_100.c1]], aggr=[[]]
494494
09)----------------Projection: aggregate_test_100.c1
495495
10)------------------Filter: aggregate_test_100.c13 != Utf8("C2GT5KVyOPZpgKVl110TyZO0NcJ434")

0 commit comments

Comments
 (0)