1818//! CoalesceBatches optimizer that groups batches together rows
1919//! in bigger batches to avoid overhead with small batches
2020
21+ use crate :: PhysicalOptimizerRule ;
22+
2123use std:: sync:: Arc ;
2224
23- use crate :: {
24- config:: ConfigOptions ,
25- error:: Result ,
26- physical_plan:: {
27- coalesce_batches:: CoalesceBatchesExec , filter:: FilterExec , joins:: HashJoinExec ,
28- repartition:: RepartitionExec , Partitioning ,
29- } ,
25+ use datafusion_common:: config:: ConfigOptions ;
26+ use datafusion_common:: error:: Result ;
27+ use datafusion_physical_expr:: Partitioning ;
28+ use datafusion_physical_plan:: {
29+ coalesce_batches:: CoalesceBatchesExec , filter:: FilterExec , joins:: HashJoinExec ,
30+ repartition:: RepartitionExec , ExecutionPlan ,
3031} ;
3132
3233use datafusion_common:: tree_node:: { Transformed , TransformedResult , TreeNode } ;
33- use datafusion_physical_optimizer:: PhysicalOptimizerRule ;
3434
3535/// Optimizer rule that introduces CoalesceBatchesExec to avoid overhead with small batches that
3636/// are produced by highly selective filters
@@ -46,9 +46,9 @@ impl CoalesceBatches {
4646impl PhysicalOptimizerRule for CoalesceBatches {
4747 fn optimize (
4848 & self ,
49- plan : Arc < dyn crate :: physical_plan :: ExecutionPlan > ,
49+ plan : Arc < dyn ExecutionPlan > ,
5050 config : & ConfigOptions ,
51- ) -> Result < Arc < dyn crate :: physical_plan :: ExecutionPlan > > {
51+ ) -> Result < Arc < dyn ExecutionPlan > > {
5252 if !config. execution . coalesce_batches {
5353 return Ok ( plan) ;
5454 }
0 commit comments