MCPcopy Create free account
hub / github.com/apache/arrow / ValueCountsFinalize

Function ValueCountsFinalize

cpp/src/arrow/compute/kernels/vector_hash.cc:640–650  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

638}
639
640Status ValueCountsFinalize(KernelContext* ctx, std::vector<Datum>* out) {
641 auto hash_impl = checked_cast<HashKernel*>(ctx->state());
642 std::shared_ptr<ArrayData> uniques;
643
644 RETURN_NOT_OK(hash_impl->GetDictionary(&uniques));
645
646 ExecResult result;
647 RETURN_NOT_OK(hash_impl->FlushFinal(&result));
648 *out = {Datum(BoxValueCounts(uniques, result.array_data()))};
649 return Status::OK();
650}
651
652// Return the dictionary from the hash kernel or allocate an empty one.
653// Required because on empty inputs, we don't ever see the input and

Callers

nothing calls this directly

Calls 7

BoxValueCountsFunction · 0.85
array_dataMethod · 0.80
DatumClass · 0.50
OKFunction · 0.50
stateMethod · 0.45
GetDictionaryMethod · 0.45
FlushFinalMethod · 0.45

Tested by

no test coverage detected