@@ -73,7 +73,6 @@ use crate::optimizer::optimizer::{OptimizerConfig, OptimizerRule};
73
73
use datafusion_sql:: { ResolvedTableReference , TableReference } ;
74
74
75
75
use crate :: physical_optimizer:: coalesce_batches:: CoalesceBatches ;
76
- use crate :: physical_optimizer:: merge_exec:: AddCoalescePartitionsExec ;
77
76
use crate :: physical_optimizer:: repartition:: Repartition ;
78
77
79
78
use crate :: config:: {
@@ -82,6 +81,7 @@ use crate::config::{
82
81
} ;
83
82
use crate :: datasource:: file_format:: file_type:: { FileCompressionType , FileType } ;
84
83
use crate :: execution:: { runtime_env:: RuntimeEnv , FunctionRegistry } ;
84
+ use crate :: physical_optimizer:: enforcement:: BasicEnforcement ;
85
85
use crate :: physical_plan:: file_format:: { plan_to_csv, plan_to_json, plan_to_parquet} ;
86
86
use crate :: physical_plan:: planner:: DefaultPhysicalPlanner ;
87
87
use crate :: physical_plan:: udaf:: AggregateUDF ;
@@ -1227,6 +1227,8 @@ pub struct SessionConfig {
1227
1227
pub parquet_pruning : bool ,
1228
1228
/// Should DataFusion collect statistics after listing files
1229
1229
pub collect_statistics : bool ,
1230
+ /// Should DataFusion optimizer run a top down process to reorder the join keys
1231
+ pub top_down_join_key_reordering : bool ,
1230
1232
/// Configuration options
1231
1233
pub config_options : Arc < RwLock < ConfigOptions > > ,
1232
1234
/// Opaque extensions.
@@ -1246,6 +1248,7 @@ impl Default for SessionConfig {
1246
1248
repartition_windows : true ,
1247
1249
parquet_pruning : true ,
1248
1250
collect_statistics : false ,
1251
+ top_down_join_key_reordering : true ,
1249
1252
config_options : Arc :: new ( RwLock :: new ( ConfigOptions :: new ( ) ) ) ,
1250
1253
// Assume no extensions by default.
1251
1254
extensions : HashMap :: with_capacity_and_hasher (
@@ -1568,6 +1571,7 @@ impl SessionState {
1568
1571
Arc :: new( AggregateStatistics :: new( ) ) ,
1569
1572
Arc :: new( HashBuildProbeOrder :: new( ) ) ,
1570
1573
] ;
1574
+ physical_optimizers. push ( Arc :: new ( BasicEnforcement :: new ( ) ) ) ;
1571
1575
if config
1572
1576
. config_options
1573
1577
. read ( )
@@ -1585,7 +1589,8 @@ impl SessionState {
1585
1589
) ) ) ;
1586
1590
}
1587
1591
physical_optimizers. push ( Arc :: new ( Repartition :: new ( ) ) ) ;
1588
- physical_optimizers. push ( Arc :: new ( AddCoalescePartitionsExec :: new ( ) ) ) ;
1592
+ physical_optimizers. push ( Arc :: new ( BasicEnforcement :: new ( ) ) ) ;
1593
+ // physical_optimizers.push(Arc::new(AddCoalescePartitionsExec::new()));
1589
1594
1590
1595
SessionState {
1591
1596
session_id,
0 commit comments