| 1215 | } |
| 1216 | |
| 1217 | Status ParseDictionary(const RjObject& obj, int64_t* id, bool* is_ordered, |
| 1218 | std::shared_ptr<DataType>* index_type) { |
| 1219 | ARROW_ASSIGN_OR_RAISE(*id, GetMemberInt<int64_t>(obj, "id")); |
| 1220 | ARROW_ASSIGN_OR_RAISE(*is_ordered, GetMemberBool(obj, "isOrdered")); |
| 1221 | |
| 1222 | ARROW_ASSIGN_OR_RAISE(const auto json_index_type, GetMemberObject(obj, "indexType")); |
| 1223 | |
| 1224 | ARROW_ASSIGN_OR_RAISE(const auto type_name, GetMemberString(json_index_type, "name")); |
| 1225 | if (type_name != "int") { |
| 1226 | return Status::Invalid("Dictionary indices can only be integers"); |
| 1227 | } |
| 1228 | return GetInteger(json_index_type).Value(index_type); |
| 1229 | } |
| 1230 |
no test coverage detected