This can't be called more than once because DictionaryUnifier::GetResult() can't be called more than once and produce the same output.
| 506 | /// This can't be called more than once because DictionaryUnifier::GetResult() |
| 507 | /// can't be called more than once and produce the same output. |
| 508 | Result<std::shared_ptr<Array>> dictionary() const { |
| 509 | if (!first_dictionary_) { // Append was never called |
| 510 | return nullptr; |
| 511 | } |
| 512 | if (!dictionary_unifier_) { // Append was called only once |
| 513 | return first_dictionary_; |
| 514 | } |
| 515 | |
| 516 | auto out_dict_type = first_dictionary_->type(); |
| 517 | std::shared_ptr<Array> out_dict; |
| 518 | RETURN_NOT_OK(dictionary_unifier_->GetResult(&out_dict_type, &out_dict)); |
| 519 | return out_dict; |
| 520 | } |
| 521 | |
| 522 | private: |
| 523 | std::unique_ptr<HashKernel> indices_kernel_; |