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

Function CheckModeWithRangeSliced

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

Source from the content-addressed store, hash-verified

3296
3297template <typename ArrowType, typename CTYPE = typename ArrowType::c_type>
3298void CheckModeWithRangeSliced(CTYPE range_min, CTYPE range_max) {
3299 auto rand = random::RandomArrayGenerator(0x5487655);
3300 auto array = rand.Numeric<ArrowType>(32 * 1024, range_min, range_max, 0.1);
3301
3302 const int64_t array_size = array->length();
3303 const std::vector<std::array<int64_t, 2>> offset_size{
3304 {0, 40},
3305 {array_size - 40, 40},
3306 {array_size / 3, array_size / 6},
3307 {array_size * 9 / 10, array_size / 10},
3308 };
3309 for (const auto& os : offset_size) {
3310 VerifyMode<ArrowType>(array->Slice(os[0], os[1]));
3311 }
3312}
3313
3314TEST_F(TestInt32ModeKernel, SmallValueRange) {
3315 // Small value range => should exercise counter-based Mode implementation

Callers

nothing calls this directly

Calls 2

lengthMethod · 0.45
SliceMethod · 0.45

Tested by

no test coverage detected