Skip to content

Commit

Permalink
Initial min/max support for primitive
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniël Heres committed Jul 5, 2023
1 parent fede032 commit 5076245
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions datafusion/physical-expr/src/aggregate/min_max.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1242,9 +1242,13 @@ where
assert_eq!(values.len(), 1, "single argument to update_batch");
let values = values.get(0).unwrap().as_primitive::<T>();

// update sums
self.min_max
.resize_with(total_num_groups, || T::default_value());
self.min_max.resize_with(total_num_groups, || {
if MIN {
T::Native::max()
} else {
T::Native::min()
}
});

// NullState dispatches / handles tracking nulls and groups that saw no values
self.null_state.accumulate(
Expand Down

0 comments on commit 5076245

Please sign in to comment.