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

Function EnsureHashDictionary

cpp/src/arrow/compute/kernels/vector_hash.cc:654–663  ·  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

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

Callers 2

UniqueFinalizeDictionaryFunction · 0.85

Calls 1

dataMethod · 0.45

Tested by

no test coverage detected