| 3273 | |
| 3274 | template <typename ArrowType, typename CTYPE = typename ArrowType::c_type> |
| 3275 | void 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 | |
| 3289 | template <typename ArrowType, typename CTYPE = typename ArrowType::c_type> |
| 3290 | void CheckModeWithRange(CTYPE range_min, CTYPE range_max) { |
nothing calls this directly
no test coverage detected