Skip to content

Commit

Permalink
Remove unnecessary reassignment (#8232)
Browse files Browse the repository at this point in the history
  • Loading branch information
qrilka authored Nov 16, 2023
1 parent 4c6f5c5 commit 37eecfe
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions datafusion/core/src/physical_planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -820,16 +820,13 @@ impl DefaultPhysicalPlanner {
let updated_aggregates = initial_aggr.aggr_expr().to_vec();
let updated_order_bys = initial_aggr.order_by_expr().to_vec();

let (initial_aggr, next_partition_mode): (
Arc<dyn ExecutionPlan>,
AggregateMode,
) = if can_repartition {
let next_partition_mode = if can_repartition {
// construct a second aggregation with 'AggregateMode::FinalPartitioned'
(initial_aggr, AggregateMode::FinalPartitioned)
AggregateMode::FinalPartitioned
} else {
// construct a second aggregation, keeping the final column name equal to the
// first aggregation and the expressions corresponding to the respective aggregate
(initial_aggr, AggregateMode::Final)
AggregateMode::Final
};

let final_grouping_set = PhysicalGroupBy::new_single(
Expand Down

0 comments on commit 37eecfe

Please sign in to comment.