| 950 | |
| 951 | template <typename MemoTableType> |
| 952 | static inline Status ComputeNullBitmap(MemoryPool* pool, const MemoTableType& memo_table, |
| 953 | int64_t start_offset, int64_t* null_count, |
| 954 | std::shared_ptr<Buffer>* null_bitmap) { |
| 955 | int64_t dict_length = static_cast<int64_t>(memo_table.size()) - start_offset; |
| 956 | int64_t null_index = memo_table.GetNull(); |
| 957 | |
| 958 | *null_count = 0; |
| 959 | *null_bitmap = nullptr; |
| 960 | |
| 961 | if (null_index != kKeyNotFound && null_index >= start_offset) { |
| 962 | null_index -= start_offset; |
| 963 | *null_count = 1; |
| 964 | ARROW_ASSIGN_OR_RAISE(*null_bitmap, |
| 965 | internal::BitmapAllButOne(pool, dict_length, null_index)); |
| 966 | } |
| 967 | |
| 968 | return Status::OK(); |
| 969 | } |
| 970 | |
| 971 | struct StringViewHash { |
| 972 | // std::hash compatible hasher for use with std::unordered_* |
no test coverage detected