Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Dandandan committed Dec 7, 2023
1 parent d7063a5 commit 879011d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions datafusion/optimizer/src/optimize_projections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,9 @@ fn optimize_projections(
// Aggregate always needs at least one aggregate expression.
// With a nested count we don't require any column as input, but still need to create a correct aggregate
// The aggregate may be optimized out later (select count(*) from (select count(*) from [...]) always returns 1
if new_aggr_expr.len() == 0
&& new_group_bys.len() == 0
&& aggregate.aggr_expr.len() > 0
if new_aggr_expr.is_empty()
&& new_group_bys.is_empty()
&& !aggregate.aggr_expr.is_empty()
{
new_aggr_expr = vec![aggregate.aggr_expr[0].clone()];
}
Expand Down

0 comments on commit 879011d

Please sign in to comment.