@@ -1757,13 +1757,11 @@ impl WorkerExec {
17571757 required_input_ordering : Option < LexRequirement > ,
17581758 worker_planning_params : WorkerPlanningParams ,
17591759 ) -> WorkerExec {
1760- let properties =
1761- input
1762- . properties ( )
1763- . clone ( )
1764- . with_partitioning ( Partitioning :: UnknownPartitioning (
1765- worker_planning_params. worker_partition_count ,
1766- ) ) ;
1760+ // This, importantly, gives us the same PlanProperties as ClusterSendExec.
1761+ let properties = ClusterSendExec :: compute_properties (
1762+ input. properties ( ) ,
1763+ worker_planning_params. worker_partition_count ,
1764+ ) ;
17671765 WorkerExec {
17681766 input,
17691767 max_batch_rows,
@@ -1796,12 +1794,16 @@ impl ExecutionPlan for WorkerExec {
17961794 ) -> Result < Arc < dyn ExecutionPlan > , DataFusionError > {
17971795 assert_eq ! ( children. len( ) , 1 ) ;
17981796 let input = children. into_iter ( ) . next ( ) . unwrap ( ) ;
1797+ let properties: PlanProperties = ClusterSendExec :: compute_properties (
1798+ input. properties ( ) ,
1799+ self . properties . output_partitioning ( ) . partition_count ( ) ,
1800+ ) ;
17991801 Ok ( Arc :: new ( WorkerExec {
18001802 input,
18011803 max_batch_rows : self . max_batch_rows ,
18021804 limit_and_reverse : self . limit_and_reverse . clone ( ) ,
18031805 required_input_ordering : self . required_input_ordering . clone ( ) ,
1804- properties : self . properties . clone ( ) ,
1806+ properties,
18051807 } ) )
18061808 }
18071809
@@ -1831,7 +1833,7 @@ impl ExecutionPlan for WorkerExec {
18311833
18321834 fn maintains_input_order ( & self ) -> Vec < bool > {
18331835 // TODO upgrade DF: If the WorkerExec has the number of partitions so it can produce the same output, we could occasionally return true.
1834- // vec![self.num_clustersend_partitions <= 1 && self. input_for_optimizations.output_partitioning().partition_count() <= 1]
1836+ // vec![self.input_for_optimizations.output_partitioning().partition_count() <= 1]
18351837
18361838 // For now, same as default implementation:
18371839 vec ! [ false ]
@@ -1883,7 +1885,7 @@ pub mod tests {
18831885 use datafusion:: error:: DataFusionError ;
18841886 use datafusion:: execution:: { SessionState , SessionStateBuilder } ;
18851887 use datafusion:: logical_expr:: { AggregateUDF , LogicalPlan , ScalarUDF , TableSource , WindowUDF } ;
1886- use datafusion:: prelude:: { SessionConfig , SessionContext } ;
1888+ use datafusion:: prelude:: SessionConfig ;
18871889 use datafusion:: sql:: TableReference ;
18881890 use std:: collections:: HashMap ;
18891891 use std:: iter:: FromIterator ;
0 commit comments