@@ -403,12 +403,13 @@ impl<T: ?Sized> Referenced<'_, T> {
403403
404404#[ cfg( test) ]
405405mod tests {
406- use crate :: DistributedExt ;
407406 use crate :: test_utils:: in_memory_channel_resolver:: InMemoryChannelResolver ;
408407 use crate :: test_utils:: parquet:: register_parquet_tables;
408+ use crate :: { DistributedExt , DistributedPhysicalOptimizerRule } ;
409409 use crate :: { assert_snapshot, display_plan_ascii} ;
410410 use datafusion:: execution:: SessionStateBuilder ;
411411 use datafusion:: prelude:: { SessionConfig , SessionContext } ;
412+ use std:: sync:: Arc ;
412413 /* shema for the "weather" table
413414
414415 MinTemp [type=DOUBLE] [repetitiontype=OPTIONAL]
@@ -441,7 +442,7 @@ mod tests {
441442 SELECT * FROM weather
442443 "# ;
443444 let plan = sql_to_explain ( query, |b| {
444- b. with_distributed_execution ( InMemoryChannelResolver :: new ( 3 ) )
445+ b. with_distributed_channel_resolver ( InMemoryChannelResolver :: new ( 3 ) )
445446 } )
446447 . await ;
447448 assert_snapshot ! ( plan, @"DataSourceExec: file_groups={3 groups: [[/testdata/weather/result-000000.parquet], [/testdata/weather/result-000001.parquet], [/testdata/weather/result-000002.parquet]]}, projection=[MinTemp, MaxTemp, Rainfall, Evaporation, Sunshine, WindGustDir, WindGustSpeed, WindDir9am, WindDir3pm, WindSpeed9am, WindSpeed3pm, Humidity9am, Humidity3pm, Pressure9am, Pressure3pm, Cloud9am, Cloud3pm, Temp9am, Temp3pm, RainToday, RISK_MM, RainTomorrow], file_type=parquet" ) ;
@@ -453,7 +454,7 @@ mod tests {
453454 SELECT count(*), "RainToday" FROM weather GROUP BY "RainToday" ORDER BY count(*)
454455 "# ;
455456 let plan = sql_to_explain ( query, |b| {
456- b. with_distributed_execution ( InMemoryChannelResolver :: new ( 3 ) )
457+ b. with_distributed_channel_resolver ( InMemoryChannelResolver :: new ( 3 ) )
457458 } )
458459 . await ;
459460 assert_snapshot ! ( plan, @r"
@@ -485,7 +486,7 @@ mod tests {
485486 SELECT count(*), "RainToday" FROM weather GROUP BY "RainToday" ORDER BY count(*)
486487 "# ;
487488 let plan = sql_to_explain ( query, |b| {
488- b. with_distributed_execution ( InMemoryChannelResolver :: new ( 2 ) )
489+ b. with_distributed_channel_resolver ( InMemoryChannelResolver :: new ( 2 ) )
489490 } )
490491 . await ;
491492 assert_snapshot ! ( plan, @r"
@@ -517,7 +518,7 @@ mod tests {
517518 SELECT count(*), "RainToday" FROM weather GROUP BY "RainToday" ORDER BY count(*)
518519 "# ;
519520 let plan = sql_to_explain ( query, |b| {
520- b. with_distributed_execution ( InMemoryChannelResolver :: new ( 0 ) )
521+ b. with_distributed_channel_resolver ( InMemoryChannelResolver :: new ( 0 ) )
521522 } )
522523 . await ;
523524 assert_snapshot ! ( plan, @r"
@@ -540,7 +541,7 @@ mod tests {
540541 SELECT count(*), "RainToday" FROM weather GROUP BY "RainToday" ORDER BY count(*)
541542 "# ;
542543 let plan = sql_to_explain ( query, |b| {
543- b. with_distributed_execution ( InMemoryChannelResolver :: new ( 3 ) )
544+ b. with_distributed_channel_resolver ( InMemoryChannelResolver :: new ( 3 ) )
544545 . with_distributed_cardinality_effect_task_scale_factor ( 3.0 )
545546 . unwrap ( )
546547 } )
@@ -571,7 +572,7 @@ mod tests {
571572 SELECT count(*), "RainToday" FROM weather GROUP BY "RainToday" ORDER BY count(*)
572573 "# ;
573574 let plan = sql_to_explain ( query, |b| {
574- b. with_distributed_execution ( InMemoryChannelResolver :: new ( 3 ) )
575+ b. with_distributed_channel_resolver ( InMemoryChannelResolver :: new ( 3 ) )
575576 . with_distributed_files_per_task ( 3 )
576577 . unwrap ( )
577578 } )
@@ -596,7 +597,7 @@ mod tests {
596597 SELECT count(*), "RainToday" FROM weather GROUP BY "RainToday" ORDER BY count(*)
597598 "# ;
598599 let plan = sql_to_explain ( query, |b| {
599- b. with_distributed_execution ( InMemoryChannelResolver :: new ( 3 ) )
600+ b. with_distributed_channel_resolver ( InMemoryChannelResolver :: new ( 3 ) )
600601 } )
601602 . await ;
602603 assert_snapshot ! ( plan, @r"
@@ -628,7 +629,7 @@ mod tests {
628629 SELECT a."MinTemp", b."MaxTemp" FROM weather a LEFT JOIN weather b ON a."RainToday" = b."RainToday"
629630 "# ;
630631 let plan = sql_to_explain ( query, |b| {
631- b. with_distributed_execution ( InMemoryChannelResolver :: new ( 3 ) )
632+ b. with_distributed_channel_resolver ( InMemoryChannelResolver :: new ( 3 ) )
632633 } )
633634 . await ;
634635 assert_snapshot ! ( plan, @r"
@@ -666,7 +667,7 @@ mod tests {
666667 ON a."RainTomorrow" = b."RainTomorrow"
667668 "# ;
668669 let plan = sql_to_explain ( query, |b| {
669- b. with_distributed_execution ( InMemoryChannelResolver :: new ( 3 ) )
670+ b. with_distributed_channel_resolver ( InMemoryChannelResolver :: new ( 3 ) )
670671 } )
671672 . await ;
672673 assert_snapshot ! ( plan, @r"
@@ -714,7 +715,7 @@ mod tests {
714715 SELECT * FROM weather ORDER BY "MinTemp" DESC
715716 "# ;
716717 let plan = sql_to_explain ( query, |b| {
717- b. with_distributed_execution ( InMemoryChannelResolver :: new ( 3 ) )
718+ b. with_distributed_channel_resolver ( InMemoryChannelResolver :: new ( 3 ) )
718719 } )
719720 . await ;
720721 assert_snapshot ! ( plan, @r"
@@ -736,7 +737,7 @@ mod tests {
736737 SELECT DISTINCT "RainToday", "WindGustDir" FROM weather
737738 "# ;
738739 let plan = sql_to_explain ( query, |b| {
739- b. with_distributed_execution ( InMemoryChannelResolver :: new ( 3 ) )
740+ b. with_distributed_channel_resolver ( InMemoryChannelResolver :: new ( 3 ) )
740741 } )
741742 . await ;
742743 assert_snapshot ! ( plan, @r"
@@ -765,7 +766,7 @@ mod tests {
765766 SHOW COLUMNS from weather
766767 "# ;
767768 let plan = sql_to_explain ( query, |b| {
768- b. with_distributed_execution ( InMemoryChannelResolver :: new ( 3 ) )
769+ b. with_distributed_channel_resolver ( InMemoryChannelResolver :: new ( 3 ) )
769770 } )
770771 . await ;
771772 assert_snapshot ! ( plan, @r"
@@ -788,6 +789,7 @@ mod tests {
788789
789790 let builder = SessionStateBuilder :: new ( )
790791 . with_default_features ( )
792+ . with_physical_optimizer_rule ( Arc :: new ( DistributedPhysicalOptimizerRule ) )
791793 . with_config ( config) ;
792794
793795 let state = f ( builder) . build ( ) ;
0 commit comments