56 std::optional<key_value_view> metadata = proxy.
metadata();
57 std::vector<metadata_pair> extension_metadata = metadata.has_value()
58 ? std::vector<metadata_pair>(
62 : std::vector<metadata_pair>{};
65 const bool has_extension_name = std::ranges::find_if(
69 return pair.first ==
"ARROW:extension:name"
73 != extension_metadata.end();
74 if (!has_extension_name)
76 extension_metadata.emplace_back(
"ARROW:extension:name",
EXTENSION_NAME);
77 extension_metadata.emplace_back(
"ARROW:extension:metadata",
"");
79 proxy.
set_metadata(std::make_optional(extension_metadata));
84 fixed_width_binary_traits::value_type,
85 fixed_width_binary_traits::const_reference,
SPARROW_API const std::string_view format() const
Gets the Arrow format string describing the data type.
void set_metadata(std::optional< R > metadata)
Sets the metadata key-value pairs.
SPARROW_API std::optional< key_value_view > metadata() const
Gets the metadata key-value pairs.
#define SPARROW_ASSERT_TRUE(expr__)
SPARROW_API std::size_t num_bytes_for_fixed_sized_binary(std::string_view format)
Get the number of bytes for a fixed width binary layout from the ArrowArray format string.
fixed_width_binary_array_impl< fixed_width_binary_traits::value_type, fixed_width_binary_traits::const_reference, uuid_extension > uuid_array
data_type
Runtime identifier of arrow data types, usually associated with raw bytes with the associated value.
static constexpr sparrow::data_type get()
Metafunction for retrieving the data_type of a typed array.
UUID array implementation following Arrow canonical extension specification.
static void init(arrow_proxy &proxy)
static constexpr std::string_view EXTENSION_NAME
static constexpr size_t UUID_SIZE