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