kszucs commented on a change in pull request #7478:
URL: https://github.com/apache/arrow/pull/7478#discussion_r442864766



##########
File path: cpp/src/arrow/compute/kernels/aggregate_test.cc
##########
@@ -399,15 +434,59 @@ class TestNumericMinMaxKernel : public ::testing::Test {
 };
 
 template <typename ArrowType>
-class TestFloatingMinMaxKernel : public TestNumericMinMaxKernel<ArrowType> {};
+class TestBooleanMinMaxKernel : public TestPrimitiveMinMaxKernel<ArrowType> {};
+
+template <typename ArrowType>
+class TestIntegerMinMaxKernel : public TestPrimitiveMinMaxKernel<ArrowType> {};
+
+template <typename ArrowType>
+class TestFloatingMinMaxKernel : public TestPrimitiveMinMaxKernel<ArrowType> 
{};
+
+TYPED_TEST_SUITE(TestBooleanMinMaxKernel, BooleanArrowType);
+TYPED_TEST(TestBooleanMinMaxKernel, Basics) {
+  MinMaxOptions options;
+  std::vector<std::string> chunked_input0 = {"[]", "[]"};
+  std::vector<std::string> chunked_input1 = {"[true, true, null]", "[true, 
null]"};
+  std::vector<std::string> chunked_input2 = {"[false, false, false]", 
"[false]"};
+  std::vector<std::string> chunked_input3 = {"[true, null]", "[null, false]"};
+
+  // SKIP nulls by default
+  this->AssertMinMaxIsNull("[]", options);
+  this->AssertMinMaxIsNull("[null, null, null]", options);
+  this->AssertMinMaxIs("[false, false, false]", false, false, options);
+  this->AssertMinMaxIs("[false, false, false, null]", false, false, options);
+  this->AssertMinMaxIs("[true, null, true, true]", true, true, options);
+  this->AssertMinMaxIs("[true, null, true, true]", true, true, options);
+  this->AssertMinMaxIs("[true, null, false, true]", false, true, options);
+  this->AssertMinMaxIsNull(chunked_input0, options);
+  this->AssertMinMaxIs(chunked_input1, true, true, options);
+  this->AssertMinMaxIs(chunked_input2, false, false, options);
+  this->AssertMinMaxIs(chunked_input3, false, true, options);
+
+  options = MinMaxOptions(MinMaxOptions::OUTPUT_NULL);
+  this->AssertMinMaxIsNull("[]", options);
+  this->AssertMinMaxIsNull("[null, null, null]", options);
+  this->AssertMinMaxIsNull("[false, null, false]", options);
+  this->AssertMinMaxIsNull("[true, null]", options);
+  this->AssertMinMaxIs("[true, true, true]", true, true, options);
+  this->AssertMinMaxIs("[false, false]", false, false, options);
+  this->AssertMinMaxIs("[false, true]", false, true, options);
+  this->AssertMinMaxIsNull(chunked_input0, options);
+  this->AssertMinMaxIsNull(chunked_input1, options);
+  this->AssertMinMaxIs(chunked_input2, false, false, options);
+  this->AssertMinMaxIsNull(chunked_input3, options);
+}
 
-TYPED_TEST_SUITE(TestNumericMinMaxKernel, IntegralArrowTypes);
-TYPED_TEST(TestNumericMinMaxKernel, Basics) {
+TYPED_TEST_SUITE(TestIntegerMinMaxKernel, IntegralArrowTypes);
+TYPED_TEST(TestIntegerMinMaxKernel, Basics) {
   MinMaxOptions options;
   std::vector<std::string> chunked_input1 = {"[5, 1, 2, 3, 4]", "[9, 1, null, 
3, 4]"};
   std::vector<std::string> chunked_input2 = {"[5, null, 2, 3, 4]", "[9, 1, 2, 
3, 4]"};
   std::vector<std::string> chunked_input3 = {"[5, 1, 2, 3, null]", "[9, 1, 
null, 3, 4]"};
 
+  // SKIP nulls by default
+  this->AssertMinMaxIsNull("[]", options);
+  this->AssertMinMaxIsNull("[null, null, null]", options);

Review comment:
       So these were returning the types' extreme values.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to