Skip to content

Commit f76c5b5

Browse files
committed
merge fix
1 parent aa944e8 commit f76c5b5

File tree

5 files changed

+21
-23
lines changed

5 files changed

+21
-23
lines changed

datafusion/expr/src/logical_plan/builder.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,9 +1062,10 @@ mod tests {
10621062
.limit(Some(2), Some(10))?
10631063
.build()?;
10641064

1065-
let expected = "Projection: #employee_csv.state, #total_salary\
1066-
\n Aggregate: groupBy=[[#employee_csv.state]], aggr=[[SUM(#employee_csv.salary) AS total_salary]]\
1067-
\n TableScan: employee_csv projection=[state, salary]";
1065+
let expected = "Limit: skip=2, fetch=10\
1066+
\n Projection: #employee_csv.state, #total_salary\
1067+
\n Aggregate: groupBy=[[#employee_csv.state]], aggr=[[SUM(#employee_csv.salary) AS total_salary]]\
1068+
\n TableScan: employee_csv projection=[state, salary]";
10681069

10691070
assert_eq!(expected, format!("{:?}", plan));
10701071

datafusion/expr/src/logical_plan/plan.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,7 @@ impl LogicalPlan {
474474
/// // Format using display_indent
475475
/// let display_string = format!("{}", plan.display_indent());
476476
///
477-
/// assert_eq!("Filter: #foo_csv.id = Int32(5)\
478-
/// \n TableScan: foo_csv",
477+
/// assert_eq!("Filter: #t1.id = Int32(5)\n TableScan: t1",
479478
/// display_string);
480479
/// ```
481480
pub fn display_indent(&self) -> impl fmt::Display + '_ {
@@ -515,8 +514,8 @@ impl LogicalPlan {
515514
/// // Format using display_indent_schema
516515
/// let display_string = format!("{}", plan.display_indent_schema());
517516
///
518-
/// assert_eq!("Filter: #foo_csv.id = Int32(5) [id:Int32]\
519-
/// \n TableScan: foo_csv [id:Int32]",
517+
/// assert_eq!("Filter: #t1.id = Int32(5) [id:Int32]\
518+
/// \n TableScan: t1 [id:Int32]",
520519
/// display_string);
521520
/// ```
522521
pub fn display_indent_schema(&self) -> impl fmt::Display + '_ {

datafusion/optimizer/src/filter_push_down.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,14 +1058,14 @@ mod tests {
10581058
"Projection: #test.a\
10591059
\n Filter: #test.a >= Int64(1)\
10601060
\n Filter: #test.a <= Int64(1)\
1061-
\n Limit: 1\
1061+
\n Limit: skip=None, fetch=1\
10621062
\n TableScan: test"
10631063
);
10641064

10651065
let expected = "\
10661066
Projection: #test.a\
10671067
\n Filter: #test.a >= Int64(1) AND #test.a <= Int64(1)\
1068-
\n Limit: 1\
1068+
\n Limit: skip=None, fetch=1\
10691069
\n TableScan: test";
10701070

10711071
assert_optimized_plan_eq(&plan, expected);

datafusion/optimizer/src/single_distinct_to_groupby.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ mod tests {
373373
.build()?;
374374

375375
// Do nothing
376-
let expected = "Aggregate: groupBy=[[#test.a]], aggr=[[COUNT(DISTINCT #test.b), COUNT(DISTINCT #test.c)]] [a:UInt32, COUNT(DISTINCT test.b):UInt64;N, COUNT(DISTINCT test.c):UInt64;N]\
376+
let expected = "Aggregate: groupBy=[[#test.a]], aggr=[[COUNT(DISTINCT #test.b), COUNT(DISTINCT #test.c)]] [a:UInt32, COUNT(DISTINCT test.b):Int64;N, COUNT(DISTINCT test.c):Int64;N]\
377377
\n TableScan: test [a:UInt32, b:UInt32, c:UInt32]";
378378

379379
assert_optimized_plan_eq(&plan, expected);
@@ -419,7 +419,7 @@ mod tests {
419419
.build()?;
420420

421421
// Do nothing
422-
let expected = "Aggregate: groupBy=[[#test.a]], aggr=[[COUNT(DISTINCT #test.b), COUNT(#test.c)]] [a:UInt32, COUNT(DISTINCT test.b):UInt64;N, COUNT(test.c):UInt64;N]\
422+
let expected = "Aggregate: groupBy=[[#test.a]], aggr=[[COUNT(DISTINCT #test.b), COUNT(#test.c)]] [a:UInt32, COUNT(DISTINCT test.b):Int64;N, COUNT(test.c):Int64;N]\
423423
\n TableScan: test [a:UInt32, b:UInt32, c:UInt32]";
424424

425425
assert_optimized_plan_eq(&plan, expected);

datafusion/sql/src/planner.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3846,10 +3846,10 @@ mod tests {
38463846
JOIN orders \
38473847
ON id = customer_id AND order_id > 1 ";
38483848
let expected = "Projection: #person.id, #orders.order_id\
3849-
\n Filter: #orders.order_id > Int64(1)\
3850-
\n Inner Join: #person.id = #orders.customer_id\
3851-
\n TableScan: person\
3852-
\n TableScan: orders";
3849+
\n Inner Join: #person.id = #orders.customer_id Filter: #orders.order_id > Int64(1)\
3850+
\n TableScan: person\
3851+
\n TableScan: orders";
3852+
38533853
quick_test(sql, expected);
38543854
}
38553855

@@ -3860,10 +3860,9 @@ mod tests {
38603860
LEFT JOIN orders \
38613861
ON id = customer_id AND order_id > 1 AND age < 30";
38623862
let expected = "Projection: #person.id, #orders.order_id\
3863-
\n Left Join: #person.id = #orders.customer_id\
3864-
\n TableScan: person\
3865-
\n Filter: #orders.order_id > Int64(1)\
3866-
\n TableScan: orders";
3863+
\n Left Join: #person.id = #orders.customer_id Filter: #orders.order_id > Int64(1) AND #person.age < Int64(30)\
3864+
\n TableScan: person\
3865+
\n TableScan: orders";
38673866
quick_test(sql, expected);
38683867
}
38693868

@@ -3874,10 +3873,9 @@ mod tests {
38743873
RIGHT JOIN orders \
38753874
ON id = customer_id AND id > 1 AND order_id < 100";
38763875
let expected = "Projection: #person.id, #orders.order_id\
3877-
\n Right Join: #person.id = #orders.customer_id\
3878-
\n Filter: #person.id > Int64(1)\
3879-
\n TableScan: person\
3880-
\n TableScan: orders";
3876+
\n Right Join: #person.id = #orders.customer_id Filter: #person.id > Int64(1) AND #orders.order_id < Int64(100)\
3877+
\n TableScan: person\
3878+
\n TableScan: orders";
38813879
quick_test(sql, expected);
38823880
}
38833881

0 commit comments

Comments
 (0)