| 1306 | } |
| 1307 | |
| 1308 | Status ProcessMap() { |
| 1309 | RETURN_NOT_OK(f_parser_.CheckAtEnd()); |
| 1310 | RETURN_NOT_OK(CheckNumChildren(1)); |
| 1311 | ARROW_ASSIGN_OR_RAISE(auto field, MakeChildField(0)); |
| 1312 | const auto& value_type = field->type(); |
| 1313 | if (value_type->id() != Type::STRUCT) { |
| 1314 | return Status::Invalid("Imported map array has unexpected child field type: ", |
| 1315 | field->ToString()); |
| 1316 | } |
| 1317 | if (value_type->num_fields() != 2) { |
| 1318 | return Status::Invalid("Imported map array has unexpected child field type: ", |
| 1319 | field->ToString()); |
| 1320 | } |
| 1321 | |
| 1322 | bool keys_sorted = (c_struct_->flags & ARROW_FLAG_MAP_KEYS_SORTED); |
| 1323 | |
| 1324 | // Some implementations of Arrow (such as Rust) use a non-standard field name |
| 1325 | // for key ("keys") and value ("values") fields. For simplicity, we override |
| 1326 | // them on import. |
| 1327 | type_ = |
| 1328 | std::make_shared<MapType>(value_type->field(0)->WithName("key"), |
| 1329 | value_type->field(1)->WithName("value"), keys_sorted); |
| 1330 | return Status::OK(); |
| 1331 | } |
| 1332 | |
| 1333 | Status ProcessFixedSizeList() { |
| 1334 | RETURN_NOT_OK(f_parser_.CheckNext(':')); |
nothing calls this directly
no test coverage detected