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