Skip to content

Apache DataFusion SQL Query Engine

ARROW-11669: [Rust] [DataFusion] Remove concurrency field from GlobalLimitExec and SortExec

Andy Grovef051c2418046
diff --git a/rust/datafusion/src/physical_plan/limit.rs b/rust/datafusion/src/physical_plan/limit.rs
index 97e4eb5074..70fb2b25f7 100644
--- a/rust/datafusion/src/physical_plan/limit.rs
+++ b/rust/datafusion/src/physical_plan/limit.rs
@@ -44,18 +44,12 @@ pub struct GlobalLimitExec {
input: Arc<dyn ExecutionPlan>,
/// Maximum number of rows to return
limit: usize,
- /// Number of threads to run parallel LocalLimitExec on
- concurrency: usize,
}
impl GlobalLimitExec {
/// Create a new MergeExec
- pub fn new(input: Arc<dyn ExecutionPlan>, limit: usize, concurrency: usize) -> Self {
- GlobalLimitExec {
- input,
- limit,
- concurrency,
- }
+ pub fn new(input: Arc<dyn ExecutionPlan>, limit: usize) -> Self {
+ GlobalLimitExec { input, limit }
}
/// Input execution plan
@@ -101,7 +95,6 @@ impl ExecutionPlan for GlobalLimitExec {
1 => Ok(Arc::new(GlobalLimitExec::new(
children[0].clone(),
self.limit,
- self.concurrency,
))),
_ => Err(DataFusionError::Internal(
"GlobalLimitExec wrong number of children".to_string(),
@@ -280,7 +273,7 @@ mod tests {
// input should have 4 partitions
assert_eq!(csv.output_partitioning().partition_count(), num_partitions);
- let limit = GlobalLimitExec::new(Arc::new(MergeExec::new(Arc::new(csv))), 7, 2);
+ let limit = GlobalLimitExec::new(Arc::new(MergeExec::new(Arc::new(csv))), 7);
// the result should contain 4 batches (one per input partition)
let iter = limit.execute(0).await?;
diff --git a/rust/datafusion/src/physical_plan/planner.rs b/rust/datafusion/src/physical_plan/planner.rs
index 3f2df33d8f..a2caadedef 100644
--- a/rust/datafusion/src/physical_plan/planner.rs
+++ b/rust/datafusion/src/physical_plan/planner.rs
@@ -318,11 +318,7 @@ impl DefaultPhysicalPlanner {
})
.collect::<Result<Vec<_>>>()?;
- Ok(Arc::new(SortExec::try_new(
- sort_expr,
- input,
- ctx_state.config.concurrency,
- )?))
+ Ok(Arc::new(SortExec::try_new(sort_expr, input)?))
}
LogicalPlan::Join {
left,
@@ -366,11 +362,7 @@ impl DefaultPhysicalPlanner {
Arc::new(LocalLimitExec::new(input, limit))
};
- Ok(Arc::new(GlobalLimitExec::new(
- input,
- limit,
- ctx_state.config.concurrency,
- )))
+ Ok(Arc::new(GlobalLimitExec::new(input, limit)))
}
LogicalPlan::CreateExternalTable { .. } => {
// There is no default plan for "CREATE EXTERNAL
diff --git a/rust/datafusion/src/physical_plan/sort.rs b/rust/datafusion/src/physical_plan/sort.rs
index 5bb77cb46b..042b9f1da8 100644
--- a/rust/datafusion/src/physical_plan/sort.rs
+++ b/rust/datafusion/src/physical_plan/sort.rs
@@ -48,8 +48,6 @@ pub struct SortExec {
input: Arc<dyn ExecutionPlan>,
/// Sort expressions
expr: Vec<PhysicalSortExpr>,
- /// Number of threads to execute input partitions on before combining into a single partition
- concurrency: usize,
}
impl SortExec {
@@ -57,13 +55,8 @@ impl SortExec {
pub fn try_new(
expr: Vec<PhysicalSortExpr>,
input: Arc<dyn ExecutionPlan>,
- concurrency: usize,
) -> Result<Self> {
- Ok(Self {
- expr,
- input,
- concurrency,
- })
+ Ok(Self { expr, input })
}
/// Input schema
@@ -109,7 +102,6 @@ impl ExecutionPlan for SortExec {
1 => Ok(Arc::new(SortExec::try_new(
self.expr.clone(),
children[0].clone(),
- self.concurrency,
)?)),
_ => Err(DataFusionError::Internal(
"SortExec wrong number of children".to_string(),
@@ -301,7 +293,6 @@ mod tests {
},
],
Arc::new(MergeExec::new(Arc::new(csv))),
- 2,
)?);
let result: Vec<RecordBatch> = collect(sort_exec).await?;
@@ -376,7 +367,6 @@ mod tests {
},
],
Arc::new(MemoryExec::try_new(&[vec![batch]], schema, None)?),
- 2,
)?);
assert_eq!(DataType::Float32, *sort_exec.schema().field(0).data_type());