Skip to content

Commit 883c951

Browse files
committed
polish
1 parent 5334a9c commit 883c951

File tree

4 files changed

+46
-59
lines changed

4 files changed

+46
-59
lines changed

datafusion/core/src/datasource/view.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ mod tests {
443443
let formatted = arrow::util::pretty::pretty_format_batches(&plan)
444444
.unwrap()
445445
.to_string();
446-
assert!(formatted.contains("t1.id = Int32(1)"));
446+
assert!(formatted.contains("FilterExec: id@0 = 1"));
447447
Ok(())
448448
}
449449

datafusion/core/tests/sql/joins.rs

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3370,11 +3370,9 @@ async fn exists_subquery_to_join_expr_filter() -> Result<()> {
33703370

33713371
let expected = vec![
33723372
"Explain [plan_type:Utf8, plan:Utf8]",
3373-
" Projection: t1.t1_id, t1.t1_name, t1.t1_int [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3374-
" LeftSemi Join: Filter: CAST(t1.t1_id AS Int64) + Int64(1) > CAST(t2.t2_id AS Int64) * Int64(2) [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3375-
" TableScan: t1 projection=[t1_id, t1_name, t1_int] [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3376-
" Projection: t2.t2_id [t2_id:UInt32;N]",
3377-
" TableScan: t2 projection=[t2_id] [t2_id:UInt32;N]",
3373+
" LeftSemi Join: Filter: CAST(t1.t1_id AS Int64) + Int64(1) > CAST(t2.t2_id AS Int64) * Int64(2) [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3374+
" TableScan: t1 projection=[t1_id, t1_name, t1_int] [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3375+
" TableScan: t2 projection=[t2_id] [t2_id:UInt32;N]",
33783376
];
33793377
let formatted = plan.display_indent_schema().to_string();
33803378
let actual: Vec<&str> = formatted.trim().lines().collect();
@@ -3414,12 +3412,11 @@ async fn exists_subquery_to_join_inner_filter() -> Result<()> {
34143412
// `t2.t2_int < 3` will be kept in the subquery filter.
34153413
let expected = vec![
34163414
"Explain [plan_type:Utf8, plan:Utf8]",
3417-
" Projection: t1.t1_id, t1.t1_name, t1.t1_int [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3418-
" LeftSemi Join: Filter: CAST(t1.t1_id AS Int64) + Int64(1) > CAST(t2.t2_id AS Int64) * Int64(2) [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3419-
" TableScan: t1 projection=[t1_id, t1_name, t1_int] [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3420-
" Projection: t2.t2_id [t2_id:UInt32;N]",
3421-
" Filter: t2.t2_int < UInt32(3) [t2_id:UInt32;N, t2_int:UInt32;N]",
3422-
" TableScan: t2 projection=[t2_id, t2_int] [t2_id:UInt32;N, t2_int:UInt32;N]",
3415+
" LeftSemi Join: Filter: CAST(t1.t1_id AS Int64) + Int64(1) > CAST(t2.t2_id AS Int64) * Int64(2) [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3416+
" TableScan: t1 projection=[t1_id, t1_name, t1_int] [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3417+
" Projection: t2.t2_id [t2_id:UInt32;N]",
3418+
" Filter: t2.t2_int < UInt32(3) [t2_id:UInt32;N, t2_int:UInt32;N]",
3419+
" TableScan: t2 projection=[t2_id, t2_int] [t2_id:UInt32;N, t2_int:UInt32;N]",
34233420
];
34243421
let formatted = plan.display_indent_schema().to_string();
34253422
let actual: Vec<&str> = formatted.trim().lines().collect();
@@ -3457,12 +3454,10 @@ async fn exists_subquery_to_join_outer_filter() -> Result<()> {
34573454
// `t1.t1_int < 3` will be moved to the filter of t1.
34583455
let expected = vec![
34593456
"Explain [plan_type:Utf8, plan:Utf8]",
3460-
" Projection: t1.t1_id, t1.t1_name, t1.t1_int [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3461-
" LeftSemi Join: Filter: CAST(t1.t1_id AS Int64) + Int64(1) > CAST(t2.t2_id AS Int64) * Int64(2) [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3462-
" Filter: t1.t1_int < UInt32(3) [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3463-
" TableScan: t1 projection=[t1_id, t1_name, t1_int] [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3464-
" Projection: t2.t2_id [t2_id:UInt32;N]",
3465-
" TableScan: t2 projection=[t2_id] [t2_id:UInt32;N]",
3457+
" LeftSemi Join: Filter: CAST(t1.t1_id AS Int64) + Int64(1) > CAST(t2.t2_id AS Int64) * Int64(2) [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3458+
" Filter: t1.t1_int < UInt32(3) [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3459+
" TableScan: t1 projection=[t1_id, t1_name, t1_int] [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3460+
" TableScan: t2 projection=[t2_id] [t2_id:UInt32;N]",
34663461
];
34673462
let formatted = plan.display_indent_schema().to_string();
34683463
let actual: Vec<&str> = formatted.trim().lines().collect();
@@ -3499,11 +3494,9 @@ async fn not_exists_subquery_to_join_expr_filter() -> Result<()> {
34993494

35003495
let expected = vec![
35013496
"Explain [plan_type:Utf8, plan:Utf8]",
3502-
" Projection: t1.t1_id, t1.t1_name, t1.t1_int [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3503-
" LeftAnti Join: Filter: CAST(t1.t1_id AS Int64) + Int64(1) > CAST(t2.t2_id AS Int64) * Int64(2) [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3504-
" TableScan: t1 projection=[t1_id, t1_name, t1_int] [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3505-
" Projection: t2.t2_id [t2_id:UInt32;N]",
3506-
" TableScan: t2 projection=[t2_id] [t2_id:UInt32;N]",
3497+
" LeftAnti Join: Filter: CAST(t1.t1_id AS Int64) + Int64(1) > CAST(t2.t2_id AS Int64) * Int64(2) [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3498+
" TableScan: t1 projection=[t1_id, t1_name, t1_int] [t1_id:UInt32;N, t1_name:Utf8;N, t1_int:UInt32;N]",
3499+
" TableScan: t2 projection=[t2_id] [t2_id:UInt32;N]",
35073500
];
35083501
let formatted = plan.display_indent_schema().to_string();
35093502
let actual: Vec<&str> = formatted.trim().lines().collect();

0 commit comments

Comments
 (0)