@@ -19,9 +19,7 @@ use super::*;
1919use arrow:: array:: StringArray ;
2020use datafusion:: catalog:: MemTable ;
2121use datafusion:: physical_plan:: ExecutionPlanProperties ;
22- use datafusion:: physical_plan:: materialized_cte:: {
23- MaterializedCteExec , MaterializedCteReaderExec ,
24- } ;
22+ use datafusion:: physical_plan:: materialize:: { MaterializeExec , MaterializedScanExec } ;
2523use datafusion:: physical_plan:: { collect_partitioned, visit_execution_plan} ;
2624use datafusion_common:: assert_batches_eq;
2725use datafusion_common:: stats:: Precision ;
@@ -42,8 +40,8 @@ async fn multi_reference_cte_materialization_heuristic() -> Result<()> {
4240 . await ?;
4341 let physical_plan = reused_scan. create_physical_plan ( ) . await ?;
4442 let plan = displayable ( physical_plan. as_ref ( ) ) . indent ( true ) . to_string ( ) ;
45- assert_contains ! ( & plan, "MaterializedCteExec " ) ;
46- assert_contains ! ( & plan, "MaterializedCteReaderExec " ) ;
43+ assert_contains ! ( & plan, "MaterializeExec " ) ;
44+ assert_contains ! ( & plan, "MaterializedScanExec " ) ;
4745
4846 let cheap_literal = ctx
4947 . sql (
@@ -53,8 +51,8 @@ async fn multi_reference_cte_materialization_heuristic() -> Result<()> {
5351 . await ?;
5452 let physical_plan = cheap_literal. create_physical_plan ( ) . await ?;
5553 let plan = displayable ( physical_plan. as_ref ( ) ) . indent ( true ) . to_string ( ) ;
56- assert_not_contains ! ( & plan, "MaterializedCteExec " ) ;
57- assert_not_contains ! ( & plan, "MaterializedCteReaderExec " ) ;
54+ assert_not_contains ! ( & plan, "MaterializeExec " ) ;
55+ assert_not_contains ! ( & plan, "MaterializedScanExec " ) ;
5856
5957 let limited_reuse = ctx
6058 . sql (
@@ -64,8 +62,8 @@ async fn multi_reference_cte_materialization_heuristic() -> Result<()> {
6462 . await ?;
6563 let physical_plan = limited_reuse. create_physical_plan ( ) . await ?;
6664 let plan = displayable ( physical_plan. as_ref ( ) ) . indent ( true ) . to_string ( ) ;
67- assert_not_contains ! ( & plan, "MaterializedCteExec " ) ;
68- assert_not_contains ! ( & plan, "MaterializedCteReaderExec " ) ;
65+ assert_not_contains ! ( & plan, "MaterializeExec " ) ;
66+ assert_not_contains ! ( & plan, "MaterializedScanExec " ) ;
6967
7068 Ok ( ( ) )
7169}
@@ -104,11 +102,11 @@ async fn materialized_cte_reader_preserves_input_partitions() -> Result<()> {
104102 type Error = std:: convert:: Infallible ;
105103
106104 fn pre_visit ( & mut self , plan : & dyn ExecutionPlan ) -> Result < bool , Self :: Error > {
107- if plan. is :: < MaterializedCteExec > ( ) {
105+ if plan. is :: < MaterializeExec > ( ) {
108106 self . producer_partitions
109107 . push ( plan. output_partitioning ( ) . partition_count ( ) ) ;
110108 }
111- if plan. is :: < MaterializedCteReaderExec > ( ) {
109+ if plan. is :: < MaterializedScanExec > ( ) {
112110 self . reader_partitions
113111 . push ( plan. output_partitioning ( ) . partition_count ( ) ) ;
114112 }
@@ -194,7 +192,7 @@ async fn materialized_cte_cache_is_per_physical_plan() -> Result<()> {
194192 . await ?;
195193 let physical_plan = first. create_physical_plan ( ) . await ?;
196194 let plan = displayable ( physical_plan. as_ref ( ) ) . indent ( true ) . to_string ( ) ;
197- assert_contains ! ( & plan, "MaterializedCteExec " ) ;
195+ assert_contains ! ( & plan, "MaterializeExec " ) ;
198196 let results = first. collect ( ) . await ?;
199197 let expected = [ "+---+" , "| a |" , "+---+" , "| 1 |" , "+---+" ] ;
200198 assert_batches_eq ! ( expected, & results) ;
@@ -207,7 +205,7 @@ async fn materialized_cte_cache_is_per_physical_plan() -> Result<()> {
207205 . await ?;
208206 let physical_plan = second. create_physical_plan ( ) . await ?;
209207 let plan = displayable ( physical_plan. as_ref ( ) ) . indent ( true ) . to_string ( ) ;
210- assert_contains ! ( & plan, "MaterializedCteExec " ) ;
208+ assert_contains ! ( & plan, "MaterializeExec " ) ;
211209 let results = second. collect ( ) . await ?;
212210 let expected = [ "+---+" , "| a |" , "+---+" , "| 2 |" , "+---+" ] ;
213211 assert_batches_eq ! ( expected, & results) ;
@@ -242,7 +240,7 @@ async fn materialized_cte_reader_preserves_producer_statistics() -> Result<()> {
242240 type Error = datafusion:: error:: DataFusionError ;
243241
244242 fn pre_visit ( & mut self , plan : & dyn ExecutionPlan ) -> Result < bool , Self :: Error > {
245- if plan. is :: < MaterializedCteReaderExec > ( ) {
243+ if plan. is :: < MaterializedScanExec > ( ) {
246244 self . reader_rows
247245 . push ( plan. partition_statistics ( None ) ?. num_rows ) ;
248246 }
@@ -361,7 +359,7 @@ async fn volatile_cte_is_materialized() -> Result<()> {
361359 . await ?;
362360 let physical_plan = df. create_physical_plan ( ) . await ?;
363361 let plan = displayable ( physical_plan. as_ref ( ) ) . indent ( true ) . to_string ( ) ;
364- assert_contains ! ( & plan, "MaterializedCteExec " ) ;
362+ assert_contains ! ( & plan, "MaterializeExec " ) ;
365363
366364 // Verify the values are actually the same (materialized = one evaluation)
367365 let results = ctx
0 commit comments