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

Function VerifyMode

cpp/src/arrow/compute/kernels/aggregate_test.cc:3275–3287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3273
3274template <typename ArrowType, typename CTYPE = typename ArrowType::c_type>
3275void VerifyMode(const std::shared_ptr<Array>& array) {
3276 auto expected = NaiveMode<ArrowType>(*array);
3277 ASSERT_OK_AND_ASSIGN(Datum out, Mode(array));
3278 const StructArray out_array(out.array());
3279 ValidateOutput(out_array);
3280 ASSERT_EQ(out_array.length(), 1);
3281 ASSERT_EQ(out_array.num_fields(), 2);
3282
3283 const CTYPE* out_modes = out_array.field(0)->data()->GetValues<CTYPE>(1);
3284 const int64_t* out_counts = out_array.field(1)->data()->GetValues<int64_t>(1);
3285 ASSERT_EQ(out_modes[0], expected.mode);
3286 ASSERT_EQ(out_counts[0], expected.count);
3287}
3288
3289template <typename ArrowType, typename CTYPE = typename ArrowType::c_type>
3290void CheckModeWithRange(CTYPE range_min, CTYPE range_max) {

Callers

nothing calls this directly

Calls 6

ValidateOutputFunction · 0.85
arrayMethod · 0.45
lengthMethod · 0.45
num_fieldsMethod · 0.45
dataMethod · 0.45
fieldMethod · 0.45

Tested by

no test coverage detected