Skip to content

Commit

Permalink
reset
Browse files Browse the repository at this point in the history
  • Loading branch information
R-JunmingChen committed Nov 6, 2023
1 parent 901484c commit f9b025f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cpp/src/arrow/compute/kernels/aggregate_basic_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1089,17 +1089,19 @@ struct DictionaryMinMaxImpl : public ScalarAggregator {
}

Status MergeFrom(KernelContext*, KernelState&& src) override {
RETURN_NOT_OK(this->InitValueState());

const auto& other = checked_cast<const ThisType&>(src);
auto&& other = checked_cast<ThisType&&>(src);
this->has_nulls |= other.has_nulls;
this->count += other.count;
if ((this->has_nulls && !options.skip_nulls) || (this->count < options.min_count)) {
return Status::OK();
}

RETURN_NOT_OK(checked_cast<ScalarAggregator*>(this->value_state.get())
->MergeFrom(nullptr, std::move(*other.value_state)));
if (this->value_state == nullptr) {
this->value_state.reset(other.value_state.release());
} else {
RETURN_NOT_OK(checked_cast<ScalarAggregator*>(this->value_state.get())
->MergeFrom(nullptr, std::move(*other.value_state)));
}
return Status::OK();
}

Expand Down

0 comments on commit f9b025f

Please sign in to comment.