| 1429 | } |
| 1430 | |
| 1431 | void 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 | |
| 1446 | TEST(TestDictionary, Compact) { |
| 1447 | std::shared_ptr<arrow::DataType> type; |
no test coverage detected