Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
R-JunmingChen committed Aug 13, 2023
1 parent 0703113 commit 5d2f51a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions cpp/src/arrow/compute/kernels/aggregate_basic_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -914,16 +914,14 @@ struct DictionaryMinMaxImpl : public ScalarAggregator {
this->has_nulls = arr.null_count() > 0;
this->count += arr.length() - arr.null_count();

std::shared_ptr<Array> dict_values = arr.dictionary();
Datum dict_values_(*std::move(dict_values));
ARROW_ASSIGN_OR_RAISE(Datum result, MinMax(std::move(dict_values_)));
Datum dict_values(arr.dictionary());
ARROW_ASSIGN_OR_RAISE(Datum result, MinMax(std::move(dict_values)));
const StructScalar& struct_result =
checked_cast<const StructScalar&>(*std::move(result.scalar()));

ARROW_ASSIGN_OR_RAISE(auto min_, struct_result.field(FieldRef("min")));
ARROW_ASSIGN_OR_RAISE(auto max_, struct_result.field(FieldRef("max")));

ARROW_RETURN_NOT_OK(CompareMinMax(std::move(min_), std::move(max_)));

return Status::OK();
}

Expand Down

0 comments on commit 5d2f51a

Please sign in to comment.