File tree Expand file tree Collapse file tree 7 files changed +23
-29
lines changed
Expand file tree Collapse file tree 7 files changed +23
-29
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1- mod execution_plan_ops;
21mod map_last_stream;
3- mod partitioning;
4- #[ allow( unused) ]
52pub mod ttl_map;
63
7- pub ( crate ) use execution_plan_ops:: * ;
84pub ( crate ) use map_last_stream:: map_last_stream;
9- pub ( crate ) use partitioning:: { scale_partitioning, scale_partitioning_props} ;
Original file line number Diff line number Diff line change 1+ use datafusion:: common:: { DataFusionError , plan_err} ;
12use datafusion:: physical_expr:: Partitioning ;
2- use datafusion:: physical_plan:: PlanProperties ;
3+ use datafusion:: physical_plan:: { ExecutionPlan , PlanProperties } ;
4+ use std:: sync:: Arc ;
35
4- pub fn scale_partitioning_props (
6+ pub ( super ) fn require_one_child (
7+ children : & [ Arc < dyn ExecutionPlan > ] ,
8+ ) -> Result < Arc < dyn ExecutionPlan > , DataFusionError > {
9+ if children. len ( ) != 1 {
10+ return plan_err ! ( "Expected exactly 1 children, got {}" , children. len( ) ) ;
11+ }
12+ Ok ( children[ 0 ] . clone ( ) )
13+ }
14+
15+ pub ( super ) fn scale_partitioning_props (
516 props : & PlanProperties ,
617 f : impl FnOnce ( usize ) -> usize ,
718) -> PlanProperties {
@@ -13,7 +24,7 @@ pub fn scale_partitioning_props(
1324 )
1425}
1526
16- pub fn scale_partitioning (
27+ pub ( super ) fn scale_partitioning (
1728 partitioning : & Partitioning ,
1829 f : impl FnOnce ( usize ) -> usize ,
1930) -> Partitioning {
Original file line number Diff line number Diff line change 11use crate :: channel_resolver_ext:: get_distributed_channel_resolver;
2- use crate :: common:: one_child;
32use crate :: distributed_physical_optimizer_rule:: NetworkBoundaryExt ;
3+ use crate :: execution_plans:: common:: require_one_child;
44use crate :: protobuf:: DistributedCodec ;
55use crate :: { ExecutionTask , Stage } ;
66use datafusion:: common:: exec_err;
@@ -98,7 +98,7 @@ impl ExecutionPlan for DistributedExec {
9898 children : Vec < Arc < dyn ExecutionPlan > > ,
9999 ) -> datafusion:: common:: Result < Arc < dyn ExecutionPlan > > {
100100 Ok ( Arc :: new ( DistributedExec {
101- plan : one_child ( & children) ?,
101+ plan : require_one_child ( & children) ?,
102102 } ) )
103103 }
104104
Original file line number Diff line number Diff line change 1+ mod common;
12mod distributed;
23mod metrics;
34mod network_coalesce;
Original file line number Diff line number Diff line change 11use crate :: channel_resolver_ext:: get_distributed_channel_resolver;
2- use crate :: common:: { one_child, scale_partitioning_props} ;
32use crate :: config_extension_ext:: ContextGrpcMetadata ;
43use crate :: distributed_physical_optimizer_rule:: { NetworkBoundary , limit_tasks_err} ;
4+ use crate :: execution_plans:: common:: { require_one_child, scale_partitioning_props} ;
55use crate :: flight_service:: DoGet ;
66use crate :: metrics:: MetricsCollectingStream ;
77use crate :: metrics:: proto:: MetricsSetProto ;
@@ -230,12 +230,12 @@ impl ExecutionPlan for NetworkCoalesceExec {
230230 match self . as_ref ( ) {
231231 Self :: Pending ( v) => {
232232 let mut v = v. clone ( ) ;
233- v. child = one_child ( & children) ?;
233+ v. child = require_one_child ( & children) ?;
234234 Ok ( Arc :: new ( Self :: Pending ( v) ) )
235235 }
236236 Self :: Ready ( v) => {
237237 let mut v = v. clone ( ) ;
238- v. input_stage . plan = MaybeEncodedPlan :: Decoded ( one_child ( & children) ?) ;
238+ v. input_stage . plan = MaybeEncodedPlan :: Decoded ( require_one_child ( & children) ?) ;
239239 Ok ( Arc :: new ( Self :: Ready ( v) ) )
240240 }
241241 }
Original file line number Diff line number Diff line change 11use crate :: channel_resolver_ext:: get_distributed_channel_resolver;
2- use crate :: common:: { one_child, scale_partitioning} ;
32use crate :: config_extension_ext:: ContextGrpcMetadata ;
43use crate :: distributed_physical_optimizer_rule:: NetworkBoundary ;
4+ use crate :: execution_plans:: common:: { require_one_child, scale_partitioning} ;
55use crate :: flight_service:: DoGet ;
66use crate :: metrics:: MetricsCollectingStream ;
77use crate :: metrics:: proto:: MetricsSetProto ;
@@ -292,12 +292,12 @@ impl ExecutionPlan for NetworkShuffleExec {
292292 match self . as_ref ( ) {
293293 Self :: Pending ( v) => {
294294 let mut v = v. clone ( ) ;
295- v. repartition_exec = one_child ( & children) ?;
295+ v. repartition_exec = require_one_child ( & children) ?;
296296 Ok ( Arc :: new ( Self :: Pending ( v) ) )
297297 }
298298 Self :: Ready ( v) => {
299299 let mut v = v. clone ( ) ;
300- v. input_stage . plan = MaybeEncodedPlan :: Decoded ( one_child ( & children) ?) ;
300+ v. input_stage . plan = MaybeEncodedPlan :: Decoded ( require_one_child ( & children) ?) ;
301301 Ok ( Arc :: new ( Self :: Ready ( v) ) )
302302 }
303303 }
You can’t perform that action at this time.
0 commit comments