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

Function ParseDictionary

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

Source from the content-addressed store, hash-verified

1215}
1216
1217Status 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

Callers 1

ARROW_ASSIGN_OR_RAISEFunction · 0.85

Calls 2

GetMemberBoolFunction · 0.85
ARROW_ASSIGN_OR_RAISEFunction · 0.70

Tested by

no test coverage detected