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

Function AssertJSONDictArray

cpp/src/arrow/json/from_string_test.cc:128–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128void AssertJSONDictArray(const std::shared_ptr<DataType>& index_type,
129 const std::shared_ptr<DataType>& value_type,
130 const std::string& json,
131 const std::string& expected_indices_json,
132 const std::string& expected_values_json) {
133 auto type = dictionary(index_type, value_type);
134
135 ASSERT_OK_AND_ASSIGN(auto expected_indices,
136 ArrayFromJSONString(index_type, expected_indices_json));
137 ASSERT_OK_AND_ASSIGN(auto expected_values,
138 ArrayFromJSONString(value_type, expected_values_json));
139
140 ASSERT_OK_AND_ASSIGN(auto actual, ArrayFromJSONString(type, json));
141 ASSERT_OK(actual->ValidateFull());
142
143 const auto& dict_array = checked_cast<const DictionaryArray&>(*actual);
144 AssertArraysEqual(*expected_indices, *dict_array.indices());
145 AssertArraysEqual(*expected_values, *dict_array.dictionary());
146}
147
148template <typename T, typename C_TYPE = typename T::c_type>
149void AssertJSONScalar(const std::shared_ptr<DataType>& type, const std::string& json,

Callers 2

TYPED_TEST_PFunction · 0.85
TESTFunction · 0.85

Calls 5

AssertArraysEqualFunction · 0.85
indicesMethod · 0.80
dictionaryFunction · 0.50
ValidateFullMethod · 0.45
dictionaryMethod · 0.45

Tested by

no test coverage detected