Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Jul 24, 2024
1 parent 57706c6 commit 4326601
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/frontend/src/optimizer/plan_node/logical_agg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ impl LogicalAgg {
non_approx_percentile_col_mapping,
} = self.separate_normal_and_special_agg();

let needs_keyed_merge = (non_approx_percentile_agg_calls.len() >= 1 && approx_percentile_agg_calls.len() >= 1) || approx_percentile_agg_calls.len() >= 2;
let needs_keyed_merge = (!non_approx_percentile_agg_calls.is_empty()
&& !approx_percentile_agg_calls.is_empty())
|| approx_percentile_agg_calls.len() >= 2;
core.input = if needs_keyed_merge {
// If there's keyed merge, we need to share the input.
StreamShare::new_from_input(stream_input.clone()).into()
Expand All @@ -88,10 +90,8 @@ impl LogicalAgg {
};
core.agg_calls = non_approx_percentile_agg_calls;

let approx_percentile = self.build_approx_percentile_aggs(
core.input.clone(),
&approx_percentile_agg_calls,
);
let approx_percentile =
self.build_approx_percentile_aggs(core.input.clone(), &approx_percentile_agg_calls);

// ====== Handle normal aggs
let total_agg_calls = core
Expand Down Expand Up @@ -119,7 +119,7 @@ impl LogicalAgg {
)?;
Ok(keyed_merge.into())
} else {
Ok(approx_percentile.into())
Ok(approx_percentile)
}
} else {
Ok(global_agg.into())
Expand Down

0 comments on commit 4326601

Please sign in to comment.