|
19 | 19 |
|
20 | 20 | #include <charconv> |
21 | 21 |
|
| 22 | +#include <arrow/extension_type.h> |
22 | 23 | #include <arrow/type.h> |
23 | 24 | #include <arrow/type_fwd.h> |
24 | 25 | #include <arrow/util/key_value_metadata.h> |
@@ -151,10 +152,10 @@ Status ValidateParquetSchemaEvolution( |
151 | 152 | } |
152 | 153 | break; |
153 | 154 | case TypeId::kUuid: |
154 | | - if (arrow_type->id() == ::arrow::Type::FIXED_SIZE_BINARY) { |
155 | | - const auto& fixed_binary = |
156 | | - internal::checked_cast<const ::arrow::FixedSizeBinaryType&>(*arrow_type); |
157 | | - if (fixed_binary.byte_width() == 16) { |
| 155 | + if (arrow_type->id() == ::arrow::Type::EXTENSION) { |
| 156 | + const auto& extension_type = |
| 157 | + internal::checked_cast<const ::arrow::ExtensionType&>(*arrow_type); |
| 158 | + if (extension_type.extension_name() == "arrow.uuid") { |
158 | 159 | return {}; |
159 | 160 | } |
160 | 161 | } |
@@ -213,10 +214,10 @@ Result<FieldProjection> ProjectStruct( |
213 | 214 | if (!field_id) { |
214 | 215 | continue; |
215 | 216 | } |
216 | | - if (const auto [iter, inserted] = field_context_map.emplace( |
217 | | - std::piecewise_construct, std::forward_as_tuple(field_id.value()), |
218 | | - std::forward_as_tuple(i, parquet_field)); |
219 | | - !inserted) [[unlikely]] { |
| 217 | + if (!field_context_map |
| 218 | + .emplace(field_id.value(), |
| 219 | + FieldContext{.local_index = i, .parquet_field = parquet_field}) |
| 220 | + .second) [[unlikely]] { |
220 | 221 | return InvalidSchema("Duplicate field id {} found in Parquet schema", |
221 | 222 | field_id.value()); |
222 | 223 | } |
|
0 commit comments