Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
R-JunmingChen committed Oct 25, 2023
1 parent 3a58ab6 commit a9ff8b3
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions cpp/src/arrow/compute/kernels/aggregate_basic_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1105,7 +1105,8 @@ struct DictionaryMinMaxImpl : public ScalarAggregator {
}

Status Finalize(KernelContext*, Datum* out) override {
if ((this->has_nulls && !options.skip_nulls) || (this->count < options.min_count) || this->valueState.get() == nullptr) {
if ((this->has_nulls && !options.skip_nulls) || (this->count < options.min_count) ||
this->valueState.get() == nullptr) {
const auto& struct_type = checked_cast<const StructType&>(*out_type);
const auto& child_type = struct_type.field(0)->type();

Expand All @@ -1131,16 +1132,16 @@ struct DictionaryMinMaxImpl : public ScalarAggregator {
std::shared_ptr<DataType> value_type;
std::unique_ptr<KernelState> valueState;

private:
inline Status InitValueState() {
if (this->valueState == nullptr) {
const DataType& value_type_ref = checked_cast<const DataType&>(*this->value_type);
MinMaxInitState<SimdLevel::NONE> valueMinMaxInitState(
nullptr, value_type_ref, out_type, ScalarAggregateOptions::Defaults());
ARROW_ASSIGN_OR_RAISE(this->valueState, valueMinMaxInitState.Create());
}
return Status::OK();
}
private:
inline Status InitValueState() {
if (this->valueState == nullptr) {
const DataType& value_type_ref = checked_cast<const DataType&>(*this->value_type);
MinMaxInitState<SimdLevel::NONE> valueMinMaxInitState(
nullptr, value_type_ref, out_type, ScalarAggregateOptions::Defaults());
ARROW_ASSIGN_OR_RAISE(this->valueState, valueMinMaxInitState.Create());
}
return Status::OK();
}
};

template <SimdLevel::type SimdLevel>
Expand Down

0 comments on commit a9ff8b3

Please sign in to comment.