MCPcopy Create free account
hub / github.com/apache/arrow / ParseDictionary

Function ParseDictionary

cpp/src/arrow/integration/json_internal.cc:1223–1233  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1221}
1222
1223Status 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

Callers 1

ARROW_ASSIGN_OR_RAISEFunction · 0.85

Calls 1

ARROW_ASSIGN_OR_RAISEFunction · 0.70

Tested by

no test coverage detected