diff --git a/src/query/sql/src/executor/format.rs b/src/query/sql/src/executor/format.rs index f1f539ab93ea..4654889a12df 100644 --- a/src/query/sql/src/executor/format.rs +++ b/src/query/sql/src/executor/format.rs @@ -97,14 +97,14 @@ impl PhysicalPlan { FormatTreeNode::with_children("Probe".to_string(), vec![probe_child]), ]; - let estimated_rows = if let Some(info) = &plan.stat_info { + let _estimated_rows = if let Some(info) = &plan.stat_info { format!("{0:.2}", info.estimated_rows) } else { String::from("None") }; Ok(FormatTreeNode::with_children( - format!("HashJoin: {} (rows: {})", plan.join_type, estimated_rows), + format!("HashJoin: {}", plan.join_type), children, )) } @@ -117,14 +117,14 @@ impl PhysicalPlan { FormatTreeNode::with_children("Right".to_string(), vec![right_child]), ]; - let estimated_rows = if let Some(info) = &plan.stat_info { + let _estimated_rows = if let Some(info) = &plan.stat_info { format!("{0:.2}", info.estimated_rows) } else { String::from("none") }; Ok(FormatTreeNode::with_children( - format!("RangeJoin: {} (rows: {})", plan.join_type, estimated_rows), + format!("RangeJoin: {}", plan.join_type,), children, )) } diff --git a/tests/sqllogictests/suites/mode/standalone/explain/join_reorder/chain.test b/tests/sqllogictests/suites/mode/standalone/explain/join_reorder/chain.test index 53a82931f3db..e0fec1332775 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain/join_reorder/chain.test +++ b/tests/sqllogictests/suites/mode/standalone/explain/join_reorder/chain.test @@ -502,7 +502,7 @@ HashJoin query T explain join select * from t right anti join t1 on t1.a = t.a ---- -HashJoin: LEFT ANTI (rows: 10.00) +HashJoin: LEFT ANTI ├── Build │ └── Scan: default.join_reorder.t (read rows: 1) └── Probe diff --git a/tests/sqllogictests/suites/mode/standalone/explain_native/join_reorder/chain.test b/tests/sqllogictests/suites/mode/standalone/explain_native/join_reorder/chain.test index b76d92597fce..d68450cd8be9 100644 --- a/tests/sqllogictests/suites/mode/standalone/explain_native/join_reorder/chain.test +++ b/tests/sqllogictests/suites/mode/standalone/explain_native/join_reorder/chain.test @@ -502,7 +502,7 @@ HashJoin query T explain join select * from t right anti join t1 on t1.a = t.a ---- -HashJoin: LEFT ANTI (rows: 10.00) +HashJoin: LEFT ANTI ├── Build │ └── Scan: default.join_reorder.t (read rows: 1) └── Probe diff --git a/tests/sqllogictests/suites/tpch/queries.test b/tests/sqllogictests/suites/tpch/queries.test index a5b04df95430..df4fe3cadce9 100644 --- a/tests/sqllogictests/suites/tpch/queries.test +++ b/tests/sqllogictests/suites/tpch/queries.test @@ -1220,13 +1220,13 @@ order by s_name, p_partkey; ---- -HashJoin: RIGHT SINGLE (rows: 320.00) +HashJoin: RIGHT SINGLE ├── Build -│ └── HashJoin: INNER (rows: 320.00) +│ └── HashJoin: INNER │ ├── Build -│ │ └── HashJoin: INNER (rows: 200.00) +│ │ └── HashJoin: INNER │ │ ├── Build -│ │ │ └── HashJoin: INNER (rows: 5.00) +│ │ │ └── HashJoin: INNER │ │ │ ├── Build │ │ │ │ └── Scan: default.tpch.region (read rows: 5) │ │ │ └── Probe @@ -1234,17 +1234,17 @@ HashJoin: RIGHT SINGLE (rows: 320.00) │ │ └── Probe │ │ └── Scan: default.tpch.supplier (read rows: 1000) │ └── Probe -│ └── HashJoin: INNER (rows: 1600.00) +│ └── HashJoin: INNER │ ├── Build │ │ └── Scan: default.tpch.part (read rows: 20000) │ └── Probe │ └── Scan: default.tpch.partsupp (read rows: 80000) └── Probe - └── HashJoin: INNER (rows: 16000.00) + └── HashJoin: INNER ├── Build - │ └── HashJoin: INNER (rows: 200.00) + │ └── HashJoin: INNER │ ├── Build - │ │ └── HashJoin: INNER (rows: 5.00) + │ │ └── HashJoin: INNER │ │ ├── Build │ │ │ └── Scan: default.tpch.region (read rows: 5) │ │ └── Probe @@ -1255,7 +1255,6 @@ HashJoin: RIGHT SINGLE (rows: 320.00) └── Scan: default.tpch.partsupp (read rows: 80000) # Q3 -onlyif todo query I explain join select l_orderkey, @@ -1281,9 +1280,9 @@ order by o_orderdate limit 5; ---- -HashJoin: INNER (rows: 178970.16) +HashJoin: INNER ├── Build -│ └── HashJoin: INNER (rows: 44700.00) +│ └── HashJoin: INNER │ ├── Build │ │ └── Scan: default.tpch.customer (read rows: 15000) │ └── Probe @@ -1315,7 +1314,7 @@ group by order by o_orderpriority; ---- -HashJoin: RIGHT SEMI (rows: 6001.23) +HashJoin: RIGHT SEMI ├── Build │ └── Scan: default.tpch.orders (read rows: 150000) └── Probe @@ -1348,19 +1347,19 @@ group by order by revenue desc; ---- -HashJoin: INNER (rows: 25224.93) +HashJoin: INNER ├── Build │ └── Scan: default.tpch.customer (read rows: 15000) └── Probe - └── HashJoin: INNER (rows: 25224.93) + └── HashJoin: INNER ├── Build │ └── Scan: default.tpch.orders (read rows: 150000) └── Probe - └── HashJoin: INNER (rows: 120114.40) + └── HashJoin: INNER ├── Build - │ └── HashJoin: INNER (rows: 200.00) + │ └── HashJoin: INNER │ ├── Build - │ │ └── HashJoin: INNER (rows: 5.00) + │ │ └── HashJoin: INNER │ │ ├── Build │ │ │ └── Scan: default.tpch.region (read rows: 5) │ │ └── Probe @@ -1426,19 +1425,19 @@ order by cust_nation, l_year; ---- -HashJoin: INNER (rows: 1882.65) +HashJoin: INNER ├── Build -│ └── HashJoin: INNER (rows: 78.40) +│ └── HashJoin: INNER │ ├── Build │ │ └── Scan: default.tpch.nation (read rows: 25) │ └── Probe │ └── Scan: default.tpch.supplier (read rows: 1000) └── Probe - └── HashJoin: INNER (rows: 24013.34) + └── HashJoin: INNER ├── Build - │ └── HashJoin: INNER (rows: 11760.00) + │ └── HashJoin: INNER │ ├── Build - │ │ └── HashJoin: INNER (rows: 1176.00) + │ │ └── HashJoin: INNER │ │ ├── Build │ │ │ └── Scan: default.tpch.nation (read rows: 25) │ │ └── Probe @@ -1488,25 +1487,25 @@ group by order by o_year; ---- -HashJoin: INNER (rows: 440.36) +HashJoin: INNER ├── Build │ └── Scan: default.tpch.nation (read rows: 25) └── Probe - └── HashJoin: INNER (rows: 440.36) + └── HashJoin: INNER ├── Build - │ └── HashJoin: INNER (rows: 440.36) + │ └── HashJoin: INNER │ ├── Build - │ │ └── HashJoin: INNER (rows: 5.00) + │ │ └── HashJoin: INNER │ │ ├── Build │ │ │ └── Scan: default.tpch.region (read rows: 5) │ │ └── Probe │ │ └── Scan: default.tpch.nation (read rows: 25) │ └── Probe - │ └── HashJoin: INNER (rows: 2201.82) + │ └── HashJoin: INNER │ ├── Build - │ │ └── HashJoin: INNER (rows: 2201.82) + │ │ └── HashJoin: INNER │ │ ├── Build - │ │ │ └── HashJoin: INNER (rows: 4003.33) + │ │ │ └── HashJoin: INNER │ │ │ ├── Build │ │ │ │ └── Scan: default.tpch.part (read rows: 20000) │ │ │ └── Probe @@ -1553,21 +1552,21 @@ order by sum_profit limit 5; ---- -HashJoin: INNER (rows: 480400.00) +HashJoin: INNER ├── Build │ └── Scan: default.tpch.partsupp (read rows: 80000) └── Probe - └── HashJoin: INNER (rows: 120100.00) + └── HashJoin: INNER ├── Build - │ └── HashJoin: INNER (rows: 1000.00) + │ └── HashJoin: INNER │ ├── Build │ │ └── Scan: default.tpch.nation (read rows: 25) │ └── Probe │ └── Scan: default.tpch.supplier (read rows: 1000) └── Probe - └── HashJoin: INNER (rows: 120100.00) + └── HashJoin: INNER ├── Build - │ └── HashJoin: INNER (rows: 120100.00) + │ └── HashJoin: INNER │ ├── Build │ │ └── Scan: default.tpch.part (read rows: 20000) │ └── Probe @@ -1609,13 +1608,13 @@ group by order by revenue desc limit 5; ---- -HashJoin: INNER (rows: 30033.74) +HashJoin: INNER ├── Build -│ └── HashJoin: INNER (rows: 7501.28) +│ └── HashJoin: INNER │ ├── Build │ │ └── Scan: default.tpch.nation (read rows: 25) │ └── Probe -│ └── HashJoin: INNER (rows: 7501.28) +│ └── HashJoin: INNER │ ├── Build │ │ └── Scan: default.tpch.orders (read rows: 150000) │ └── Probe @@ -1653,11 +1652,11 @@ group by order by value desc limit 100; ---- -RangeJoin: INNER (rows: 3200.00) +RangeJoin: INNER ├── Left -│ └── HashJoin: INNER (rows: 3200.00) +│ └── HashJoin: INNER │ ├── Build -│ │ └── HashJoin: INNER (rows: 40.00) +│ │ └── HashJoin: INNER │ │ ├── Build │ │ │ └── Scan: default.tpch.nation (read rows: 25) │ │ └── Probe @@ -1665,9 +1664,9 @@ RangeJoin: INNER (rows: 3200.00) │ └── Probe │ └── Scan: default.tpch.partsupp (read rows: 80000) └── Right - └── HashJoin: INNER (rows: 3200.00) + └── HashJoin: INNER ├── Build - │ └── HashJoin: INNER (rows: 40.00) + │ └── HashJoin: INNER │ ├── Build │ │ └── Scan: default.tpch.nation (read rows: 25) │ └── Probe @@ -1706,7 +1705,7 @@ group by order by l_shipmode; ---- -HashJoin: INNER (rows: 120100.00) +HashJoin: INNER ├── Build │ └── Scan: default.tpch.lineitem (read rows: 600572) └── Probe @@ -1738,7 +1737,7 @@ order by custdist desc, c_count desc; ---- -HashJoin: RIGHT OUTER (rows: 120000.00) +HashJoin: RIGHT OUTER ├── Build │ └── Scan: default.tpch.customer (read rows: 15000) └── Probe @@ -1760,7 +1759,7 @@ where and l_shipdate >= to_date('1995-09-01') and l_shipdate < add_months(to_date('1995-09-01'), 1); ---- -HashJoin: INNER (rows: 12012.09) +HashJoin: INNER ├── Build │ └── Scan: default.tpch.lineitem (read rows: 600572) └── Probe @@ -1799,11 +1798,11 @@ where order by s_suppkey; ---- -HashJoin: INNER (rows: 80.00) +HashJoin: INNER ├── Build │ └── Scan: default.tpch.lineitem (read rows: 600572) └── Probe - └── HashJoin: INNER (rows: 80.00) + └── HashJoin: INNER ├── Build │ └── Scan: default.tpch.lineitem (read rows: 600572) └── Probe @@ -1846,11 +1845,11 @@ MaterializedCte: 0 ├── Left │ └── Scan: default.tpch.lineitem (read rows: 600572) └── Right - └── HashJoin: INNER (rows: 80.00) + └── HashJoin: INNER ├── Build │ └── CteScan: 0, sub index: 2 └── Probe - └── HashJoin: INNER (rows: 80.00) + └── HashJoin: INNER ├── Build │ └── CteScan: 0, sub index: 1 └── Probe @@ -1890,11 +1889,11 @@ order by p_size limit 20; ---- -HashJoin: RIGHT MARK (rows: 16000.00) +HashJoin: RIGHT MARK ├── Build │ └── Scan: default.tpch.supplier (read rows: 1000) └── Probe - └── HashJoin: INNER (rows: 16000.00) + └── HashJoin: INNER ├── Build │ └── Scan: default.tpch.part (read rows: 20000) └── Probe @@ -1920,9 +1919,9 @@ where l_partkey = p_partkey ); ---- -HashJoin: RIGHT SINGLE (rows: 15012.50) +HashJoin: RIGHT SINGLE ├── Build -│ └── HashJoin: INNER (rows: 15012.50) +│ └── HashJoin: INNER │ ├── Build │ │ └── Scan: default.tpch.part (read rows: 20000) │ └── Probe @@ -1965,13 +1964,13 @@ order by o_totalprice desc, o_orderdate; ---- -HashJoin: LEFT SEMI (rows: 120114.40) +HashJoin: LEFT SEMI ├── Build │ └── Scan: default.tpch.lineitem (read rows: 600572) └── Probe - └── HashJoin: INNER (rows: 600572.00) + └── HashJoin: INNER ├── Build - │ └── HashJoin: INNER (rows: 150000.00) + │ └── HashJoin: INNER │ ├── Build │ │ └── Scan: default.tpch.customer (read rows: 15000) │ └── Probe @@ -2051,7 +2050,7 @@ where ) ; ---- -HashJoin: INNER (rows: 69216.03) +HashJoin: INNER ├── Build │ └── Scan: default.tpch.part (read rows: 20000) └── Probe @@ -2097,17 +2096,17 @@ where order by s_name; ---- -HashJoin: RIGHT SEMI (rows: 40.00) +HashJoin: RIGHT SEMI ├── Build -│ └── HashJoin: INNER (rows: 40.00) +│ └── HashJoin: INNER │ ├── Build │ │ └── Scan: default.tpch.nation (read rows: 25) │ └── Probe │ └── Scan: default.tpch.supplier (read rows: 1000) └── Probe - └── HashJoin: RIGHT SINGLE (rows: 16000.00) + └── HashJoin: RIGHT SINGLE ├── Build - │ └── HashJoin: LEFT SEMI (rows: 16000.00) + │ └── HashJoin: LEFT SEMI │ ├── Build │ │ └── Scan: default.tpch.part (read rows: 20000) │ └── Probe @@ -2157,15 +2156,15 @@ order by numwait desc, s_name; ---- -HashJoin: RIGHT ANTI (rows: 4804.58) +HashJoin: RIGHT ANTI ├── Build -│ └── HashJoin: RIGHT SEMI (rows: 4804.58) +│ └── HashJoin: RIGHT SEMI │ ├── Build -│ │ └── HashJoin: INNER (rows: 4804.58) +│ │ └── HashJoin: INNER │ │ ├── Build -│ │ │ └── HashJoin: INNER (rows: 4804.58) +│ │ │ └── HashJoin: INNER │ │ │ ├── Build -│ │ │ │ └── HashJoin: INNER (rows: 40.00) +│ │ │ │ └── HashJoin: INNER │ │ │ │ ├── Build │ │ │ │ │ └── Scan: default.tpch.nation (read rows: 25) │ │ │ │ └── Probe @@ -2219,9 +2218,9 @@ group by order by cntrycode; ---- -HashJoin: RIGHT ANTI (rows: 3000.00) +HashJoin: RIGHT ANTI ├── Build -│ └── RangeJoin: INNER (rows: 3000.00) +│ └── RangeJoin: INNER │ ├── Left │ │ └── Scan: default.tpch.customer (read rows: 15000) │ └── Right