| 2380 | |
| 2381 | template <typename ArrowType> |
| 2382 | void ValidateMinMax(const Array& array, const ScalarAggregateOptions& options) { |
| 2383 | using Traits = TypeTraits<ArrowType>; |
| 2384 | using ScalarType = typename Traits::ScalarType; |
| 2385 | |
| 2386 | ASSERT_OK_AND_ASSIGN(Datum out, MinMax(array, options)); |
| 2387 | const StructScalar& value = out.scalar_as<StructScalar>(); |
| 2388 | |
| 2389 | auto expected = NaiveMinMax<ArrowType>(array); |
| 2390 | const auto& out_min = checked_cast<const ScalarType&>(*value.value[0]); |
| 2391 | const auto& out_max = checked_cast<const ScalarType&>(*value.value[1]); |
| 2392 | |
| 2393 | if (expected.is_valid) { |
| 2394 | ASSERT_TRUE(out_min.is_valid); |
| 2395 | ASSERT_TRUE(out_max.is_valid); |
| 2396 | ASSERT_EQ(expected.min, out_min.value); |
| 2397 | ASSERT_EQ(expected.max, out_max.value); |
| 2398 | } else { // All null values |
| 2399 | ASSERT_FALSE(out_min.is_valid); |
| 2400 | ASSERT_FALSE(out_max.is_valid); |
| 2401 | } |
| 2402 | } |
| 2403 | |
| 2404 | template <typename ArrowType> |
| 2405 | class TestRandomNumericMinMaxKernel : public ::testing::Test {}; |
nothing calls this directly
no outgoing calls
no test coverage detected