@@ -25,6 +25,7 @@ use databend_query::storages::TableStreamReadWrap;
25
25
use databend_query:: storages:: ToReadDataSourcePlan ;
26
26
use databend_query:: table_functions:: NumbersTable ;
27
27
use futures:: TryStreamExt ;
28
+ use pretty_assertions:: assert_eq;
28
29
29
30
use crate :: tests:: ConfigBuilder ;
30
31
use crate :: tests:: TestGlobalServices ;
@@ -71,18 +72,13 @@ async fn test_limit_push_down() -> Result<()> {
71
72
struct Test {
72
73
name : & ' static str ,
73
74
query : & ' static str ,
74
- expect : & ' static str ,
75
75
result : Vec < & ' static str > ,
76
76
}
77
77
78
78
let tests: Vec < Test > = vec ! [
79
79
Test {
80
80
name: "only-limit" ,
81
81
query: "select * from numbers_mt(10) limit 2" ,
82
- expect: "\
83
- Limit: 2\
84
- \n Projection: number:UInt64\
85
- \n ReadDataSource: scan schema: [number:UInt64], statistics: [read_rows: 2, read_bytes: 16, partitions_scanned: 1, partitions_total: 1], push_downs: [projections: [0], limit: 2]",
86
82
result: vec![
87
83
"+--------+" ,
88
84
"| number |" ,
@@ -95,11 +91,6 @@ async fn test_limit_push_down() -> Result<()> {
95
91
Test {
96
92
name: "limit-with-filter" ,
97
93
query: "select * from numbers_mt(10) where number > 8 limit 2" ,
98
- expect: "\
99
- Limit: 2\
100
- \n Projection: number:UInt64\
101
- \n Filter: (number > 8)\
102
- \n ReadDataSource: scan schema: [number:UInt64], statistics: [read_rows: 10, read_bytes: 80, partitions_scanned: 1, partitions_total: 1], push_downs: [projections: [0], filters: [(number > 8)], limit: 2]",
103
94
result: vec![
104
95
"+--------+" ,
105
96
"| number |" ,
@@ -119,9 +110,6 @@ async fn test_limit_push_down() -> Result<()> {
119
110
let mut planner = Planner :: new ( ctx. clone ( ) ) ;
120
111
let ( plan, _, _) = planner. plan_sql ( test. query ) . await ?;
121
112
122
- let actual = format ! ( "{:?}" , plan) ;
123
- assert_eq ! ( test. expect, actual, "{:#?}" , test. name) ;
124
-
125
113
let executor = InterpreterFactoryV2 :: get ( ctx. clone ( ) , & plan) . await ?;
126
114
127
115
let stream = executor. execute ( ctx. clone ( ) ) . await ?;
0 commit comments