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

Function ValueCountsFinalize

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

Source from the content-addressed store, hash-verified

637}
638
639Status ValueCountsFinalize(KernelContext* ctx, std::vector<Datum>* out) {
640 auto hash_impl = checked_cast<HashKernel*>(ctx->state());
641 std::shared_ptr<ArrayData> uniques;
642
643 RETURN_NOT_OK(hash_impl->GetDictionary(&uniques));
644
645 ExecResult result;
646 RETURN_NOT_OK(hash_impl->FlushFinal(&result));
647 *out = {Datum(BoxValueCounts(uniques, result.array_data()))};
648 return Status::OK();
649}
650
651// Return the dictionary from the hash kernel or allocate an empty one.
652// 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