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

Function CheckDictionaryCompact

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

Source from the content-addressed store, hash-verified

1546}
1547
1548void CheckDictionaryCompact(const std::shared_ptr<DataType>& dict_type,
1549 const std::string& input_dictionary_json,
1550 const std::string& input_index_json,
1551 const std::string& expected_dictionary_json,
1552 const std::string& expected_index_json) {
1553 auto input = DictArrayFromJSON(dict_type, input_index_json, input_dictionary_json);
1554 const DictionaryArray& input_ref = checked_cast<const DictionaryArray&>(*input);
1555
1556 auto expected =
1557 DictArrayFromJSON(dict_type, expected_index_json, expected_dictionary_json);
1558
1559 ASSERT_OK_AND_ASSIGN(std::shared_ptr<Array> actual, input_ref.Compact());
1560 AssertArraysEqual(*expected, *actual, /*verbose=*/true);
1561}
1562
1563TEST(TestDictionary, Compact) {
1564 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