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

Function CheckDictionaryCompact

cpp/src/arrow/array/array_dict_test.cc:1431–1444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1429}
1430
1431void CheckDictionaryCompact(const std::shared_ptr<DataType>& dict_type,
1432 const std::string& input_dictionary_json,
1433 const std::string& input_index_json,
1434 const std::string& expected_dictionary_json,
1435 const std::string& expected_index_json) {
1436 auto input = DictArrayFromJSON(dict_type, input_index_json, input_dictionary_json);
1437 const DictionaryArray& input_ref = checked_cast<const DictionaryArray&>(*input);
1438
1439 auto expected =
1440 DictArrayFromJSON(dict_type, expected_index_json, expected_dictionary_json);
1441
1442 ASSERT_OK_AND_ASSIGN(std::shared_ptr<Array> actual, input_ref.Compact());
1443 AssertArraysEqual(*expected, *actual, /*verbose=*/true);
1444}
1445
1446TEST(TestDictionary, Compact) {
1447 std::shared_ptr<arrow::DataType> type;

Callers 1

TESTFunction · 0.85

Calls 4

DictArrayFromJSONFunction · 0.85
AssertArraysEqualFunction · 0.85
CompactMethod · 0.80
ASSERT_OK_AND_ASSIGNFunction · 0.70

Tested by

no test coverage detected