Skip to content

Commit 96e7101

Browse files
committed
revert unnecessary changes
1 parent 7453e4d commit 96e7101

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • datafusion/expr/src/logical_plan

datafusion/expr/src/logical_plan/plan.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3770,11 +3770,11 @@ impl PartialOrd for Aggregate {
37703770
/// Returns 0 when no grouping set is duplicated.
37713771
fn max_grouping_set_duplicate_ordinal(group_expr: &[Expr]) -> usize {
37723772
if let Some(Expr::GroupingSet(GroupingSet::GroupingSets(sets))) = group_expr.first() {
3773-
sets.iter()
3774-
.map(|set| sets.iter().filter(|other| *other == set).count())
3775-
.max()
3776-
.unwrap_or(0)
3777-
.saturating_sub(1)
3773+
let mut counts: HashMap<&[Expr], usize> = HashMap::new();
3774+
for set in sets {
3775+
*counts.entry(set).or_insert(0) += 1;
3776+
}
3777+
counts.into_values().max().unwrap_or(0).saturating_sub(1)
37783778
} else {
37793779
0
37803780
}

0 commit comments

Comments
 (0)