Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary reassignment #8232

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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