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.
| 653 | // Required because on empty inputs, we don't ever see the input and |
| 654 | // hence have no dictionary. |
| 655 | Result<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 | |
| 666 | Status UniqueFinalizeDictionary(KernelContext* ctx, std::vector<Datum>* out) { |
| 667 | RETURN_NOT_OK(UniqueFinalize(ctx, out)); |
no test coverage detected