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

Function DictEncodeFinalize

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

Source from the content-addressed store, hash-verified

616}
617
618Status DictEncodeFinalize(KernelContext* ctx, std::vector<Datum>* out) {
619 auto hash_impl = checked_cast<HashKernel*>(ctx->state());
620 std::shared_ptr<ArrayData> uniques;
621 RETURN_NOT_OK(hash_impl->GetDictionary(&uniques));
622 auto dict_type = dictionary(int32(), uniques->type);
623 auto dict = MakeArray(uniques);
624 for (size_t i = 0; i < out->size(); ++i) {
625 (*out)[i] =
626 std::make_shared<DictionaryArray>(dict_type, (*out)[i].make_array(), dict);
627 }
628 return Status::OK();
629}
630
631std::shared_ptr<ArrayData> BoxValueCounts(const std::shared_ptr<ArrayData>& uniques,
632 const std::shared_ptr<ArrayData>& counts) {

Callers

nothing calls this directly

Calls 7

make_arrayMethod · 0.80
MakeArrayFunction · 0.70
dictionaryFunction · 0.50
OKFunction · 0.50
stateMethod · 0.45
GetDictionaryMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected