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