Given an extension type, return a field of its storage type + the serialized extension metadata.
| 3836 | // Given an extension type, return a field of its storage type + the |
| 3837 | // serialized extension metadata. |
| 3838 | std::shared_ptr<Field> GetStorageWithMetadata(const std::string& field_name, |
| 3839 | const std::shared_ptr<DataType>& type) { |
| 3840 | const auto& ext_type = checked_cast<const ExtensionType&>(*type); |
| 3841 | auto storage_type = ext_type.storage_type(); |
| 3842 | auto md = KeyValueMetadata::Make({kExtensionTypeKeyName, kExtensionMetadataKeyName}, |
| 3843 | {ext_type.extension_name(), ext_type.Serialize()}); |
| 3844 | return field(field_name, storage_type, /*nullable=*/true, md); |
| 3845 | } |
| 3846 | |
| 3847 | TEST_F(TestSchemaRoundtrip, UnregisteredExtension) { |
| 3848 | TestWithTypeFactory(uuid, []() { return fixed_size_binary(16); }); |
no test coverage detected