| 477 | } |
| 478 | |
| 479 | static Status GetDictionaryEncoding(FBB& fbb, const std::shared_ptr<Field>& field, |
| 480 | const DictionaryType& type, int64_t dictionary_id, |
| 481 | DictionaryOffset* out) { |
| 482 | // We assume that the dictionary index type (as an integer) has already been |
| 483 | // validated elsewhere, and can safely assume we are dealing with integers |
| 484 | const auto& index_type = checked_cast<const IntegerType&>(*type.index_type()); |
| 485 | |
| 486 | auto index_type_offset = |
| 487 | flatbuf::CreateInt(fbb, index_type.bit_width(), index_type.is_signed()); |
| 488 | |
| 489 | *out = flatbuf::CreateDictionaryEncoding(fbb, dictionary_id, index_type_offset, |
| 490 | type.ordered()); |
| 491 | return Status::OK(); |
| 492 | } |
| 493 | |
| 494 | static KeyValueOffset AppendKeyValue(FBB& fbb, const std::string& key, |
| 495 | const std::string& value) { |
no test coverage detected