| 236 | } |
| 237 | |
| 238 | Status DictionaryMemo::AddDictionaryType(int64_t id, |
| 239 | const std::shared_ptr<DataType>& type) { |
| 240 | // AddDictionaryType expects the dict value type |
| 241 | DCHECK_NE(type->id(), Type::DICTIONARY); |
| 242 | const auto pair = impl_->id_to_type_.emplace(id, type); |
| 243 | if (!pair.second && !pair.first->second->Equals(*type)) { |
| 244 | return Status::KeyError("Conflicting dictionary types for id ", id); |
| 245 | } |
| 246 | return Status::OK(); |
| 247 | } |
| 248 | |
| 249 | bool DictionaryMemo::HasDictionary(int64_t id) const { |
| 250 | const auto it = impl_->id_to_dictionary_.find(id); |