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

Function EnsureHashDictionary

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

Return the dictionary from the hash kernel or allocate an empty one. Required because on empty inputs, we don't ever see the input and hence have no dictionary.

Source from the content-addressed store, hash-verified

653// Required because on empty inputs, we don't ever see the input and
654// hence have no dictionary.
655Result<std::shared_ptr<ArrayData>> EnsureHashDictionary(KernelContext* ctx,
656 DictionaryHashKernel* hash) {
657 ARROW_ASSIGN_OR_RAISE(auto dict, hash->dictionary());
658 if (dict) {
659 return dict->data();
660 }
661 ARROW_ASSIGN_OR_RAISE(auto null, MakeArrayOfNull(hash->dictionary_value_type(),
662 /*length=*/0, ctx->memory_pool()));
663 return null->data();
664}
665
666Status UniqueFinalizeDictionary(KernelContext* ctx, std::vector<Datum>* out) {
667 RETURN_NOT_OK(UniqueFinalize(ctx, out));

Callers 2

UniqueFinalizeDictionaryFunction · 0.85

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected