@@ -6,9 +6,12 @@ mod tests {
66 use async_trait:: async_trait;
77 use datafusion:: error:: DataFusionError ;
88 use datafusion:: execution:: SessionStateBuilder ;
9+ use datafusion:: physical_plan:: displayable;
910 use datafusion:: prelude:: { SessionConfig , SessionContext } ;
1011 use datafusion_distributed:: test_utils:: localhost:: start_localhost_context;
11- use datafusion_distributed:: { DistributedPhysicalOptimizerRule , SessionBuilder } ;
12+ use datafusion_distributed:: {
13+ display_stage_graphviz, DistributedPhysicalOptimizerRule , ExecutionStage , SessionBuilder ,
14+ } ;
1215 use futures:: TryStreamExt ;
1316 use std:: error:: Error ;
1417 use std:: sync:: Arc ;
@@ -119,8 +122,6 @@ mod tests {
119122 }
120123
121124 #[ tokio:: test]
122- // TODO: Add support for NestedLoopJoinExec to support query 22.
123- #[ ignore]
124125 async fn test_tpch_22 ( ) -> Result < ( ) , Box < dyn Error > > {
125126 test_tpch_query ( 22 ) . await
126127 }
@@ -155,7 +156,6 @@ mod tests {
155156
156157 config. options_mut ( ) . optimizer . prefer_hash_join = true ;
157158 // end critical options section
158-
159159 let rule = DistributedPhysicalOptimizerRule :: new ( ) . with_maximum_partitions_per_task ( 2 ) ;
160160 Ok ( builder
161161 . with_config ( config)
@@ -174,7 +174,6 @@ mod tests {
174174 // and once in a non-distributed manner. For each query, it asserts that the results are identical.
175175 async fn run_tpch_query ( ctx2 : SessionContext , query_id : u8 ) -> Result < ( ) , Box < dyn Error > > {
176176 ensure_tpch_data ( ) . await ;
177-
178177 let sql = get_test_tpch_query ( query_id) ;
179178
180179 // Context 1: Non-distributed execution.
@@ -205,19 +204,21 @@ mod tests {
205204 . await ?;
206205 }
207206
207+ // Query 15 has three queries in it, one creating the view, the second
208+ // executing, which we want to capture the output of, and the third
209+ // tearing down the view
208210 let ( stream1, stream2) = if query_id == 15 {
209211 let queries: Vec < & str > = sql
210212 . split ( ';' )
211213 . map ( str:: trim)
212214 . filter ( |s| !s. is_empty ( ) )
213215 . collect ( ) ;
214216
215- println ! ( "queryies: {:?}" , queries) ;
216-
217217 ctx1. sql ( queries[ 0 ] ) . await ?. collect ( ) . await ?;
218218 ctx2. sql ( queries[ 0 ] ) . await ?. collect ( ) . await ?;
219219 let df1 = ctx1. sql ( queries[ 1 ] ) . await ?;
220220 let df2 = ctx2. sql ( queries[ 1 ] ) . await ?;
221+
221222 let stream1 = df1. execute_stream ( ) . await ?;
222223 let stream2 = df2. execute_stream ( ) . await ?;
223224
@@ -227,6 +228,7 @@ mod tests {
227228 } else {
228229 let stream1 = ctx1. sql ( & sql) . await ?. execute_stream ( ) . await ?;
229230 let stream2 = ctx2. sql ( & sql) . await ?. execute_stream ( ) . await ?;
231+
230232 ( stream1, stream2)
231233 } ;
232234
0 commit comments