zhuqi-lucas commented on PR #16196: URL: https://github.com/apache/datafusion/pull/16196#issuecomment-2916186751
Another solution is using CoalescePartitionsExec to wrapper: ```rust diff --git a/datafusion/physical-plan/src/coalesce_partitions.rs b/datafusion/physical-plan/src/coalesce_partitions.rs index 114f83068..ffb24463e 100644 --- a/datafusion/physical-plan/src/coalesce_partitions.rs +++ b/datafusion/physical-plan/src/coalesce_partitions.rs @@ -154,10 +154,10 @@ impl ExecutionPlan for CoalescePartitionsExec { 0 => internal_err!( "CoalescePartitionsExec requires at least one input partition" ), - 1 => { - // bypass any threading / metrics if there is a single partition - self.input.execute(0, context) - } + // 1 => { + // // bypass any threading / metrics if there is a single partition + // self.input.execute(0, context) + // } _ => { let baseline_metrics = BaselineMetrics::new(&self.metrics, partition); // record the (very) minimal work done so that diff --git a/datafusion/physical-plan/src/execution_plan.rs b/datafusion/physical-plan/src/execution_plan.rs index b81b3c8be..8bb8b2145 100644 --- a/datafusion/physical-plan/src/execution_plan.rs +++ b/datafusion/physical-plan/src/execution_plan.rs @@ -963,8 +963,7 @@ pub fn execute_stream( ) -> Result<SendableRecordBatchStream> { match plan.output_partitioning().partition_count() { 0 => Ok(Box::pin(EmptyRecordBatchStream::new(plan.schema()))), - 1 => plan.execute(0, context), - 2.. => { + 1.. => { // merge into a single partition let plan = CoalescePartitionsExec::new(Arc::clone(&plan)); // CoalescePartitionsExec must produce a single partition diff --git a/parquet-testing b/parquet-testing index 6e851ddd7..107b36603 160000 --- a/parquet-testing +++ b/parquet-testing @@ -1 +1 @@ -Subproject commit 6e851ddd768d6af741c7b15dc594874399fc3cff +Subproject commit 107b36603e051aee26bd93e04b871034f6c756c0 ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org