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

Function CheckValueCounts

cpp/src/arrow/compute/kernels/vector_hash_test.cc:92–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90
91template <typename T>
92void CheckValueCounts(const std::shared_ptr<T>& input,
93 const std::shared_ptr<Array>& expected_values,
94 const std::shared_ptr<Array>& expected_counts) {
95 ASSERT_OK_AND_ASSIGN(std::shared_ptr<Array> result, ValueCounts(input));
96 ValidateOutput(*result);
97 auto result_struct = std::dynamic_pointer_cast<StructArray>(result);
98 ASSERT_EQ(result_struct->num_fields(), 2);
99 // TODO: We probably shouldn't rely on value ordering.
100 ASSERT_ARRAYS_EQUAL(*expected_values, *result_struct->field(kValuesFieldIndex));
101 ASSERT_ARRAYS_EQUAL(*expected_counts, *result_struct->field(kCountsFieldIndex));
102}
103
104template <typename Type, typename T>
105void CheckValueCounts(const std::shared_ptr<DataType>& type,

Callers 2

TYPED_TESTFunction · 0.85
TEST_FFunction · 0.85

Calls 5

ValidateOutputFunction · 0.85
ASSERT_OK_AND_ASSIGNFunction · 0.70
num_fieldsMethod · 0.45
fieldMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected