wjones127 commented on code in PR #34761:
URL: https://github.com/apache/arrow/pull/34761#discussion_r1154820477


##########
cpp/src/arrow/compute/kernels/vector_run_end_encode_test.cc:
##########
@@ -317,7 +320,52 @@ INSTANTIATE_TEST_SUITE_P(
             REETestData::TypeMinMaxNull<Int64Type>(),
             REETestData::TypeMinMaxNull<UInt64Type>(),
             REETestData::TypeMinMaxNull<FloatType>(),
-            REETestData::TypeMinMaxNull<DoubleType>()),
+            REETestData::TypeMinMaxNull<DoubleType>(),
+            // A few temporal types
+            REETestData::JSON(
+                date32(), "[86400, 86400, 0, 432000, 432000, 432000, 22075200, 
22075200]",
+                "[86400, 0, 432000, 22075200]", "[2, 3, 6, 8]"),
+            REETestData::JSON(date64(),
+                              "[86400000, 86400000, 0, 432000000, 432000000, 
432000000, "
+                              "22032000000, 22032000000]",
+                              "[86400000, 0, 432000000, 22032000000]", "[2, 3, 
6, 8]"),
+            REETestData::JSON(time32(TimeUnit::SECOND), "[1, 1, 0, 5, 5, 5, 
255, 255]",
+                              "[1, 0, 5, 255]", "[2, 3, 6, 8]"),
+            REETestData::JSON(time64(TimeUnit::MICRO), "[1, 1, 0, 5, 5, 5, 
255, 255]",
+                              "[1, 0, 5, 255]", "[2, 3, 6, 8]"),
+            // Decimal and fixed size binary types
+            REETestData::JSON(
+                decimal128(4, 1),
+                R"(["1.0", "1.0", "0.0", "5.2", "5.2", "5.2", "255.0", 
"255.0"])",
+                R"(["1.0", "0.0", "5.2", "255.0"])", "[2, 3, 6, 8]"),
+            REETestData::JSON(
+                decimal256(4, 1),
+                R"(["1.0", "1.0", "0.0", "5.2", "5.2", "5.2", "255.0", 
"255.0"])",
+                R"(["1.0", "0.0", "5.2", "255.0"])", "[2, 3, 6, 8]"),
+            REETestData::JSON(
+                fixed_size_binary(3),
+                R"(["abc", "abc", "abc", "def", "def", "def", "ghi", "ghi"])",
+                R"(["abc", "def", "ghi"])", "[3, 6, 8]"),
+            REETestData::JSON(
+                fixed_size_binary(3),
+                R"([null, "abc", "abc", "abc", "def", "def", "def", "ghi", 
"ghi", null, null])",
+                R"([null, "abc", "def", "ghi", null])", "[1, 4, 7, 9, 11]"),
+            // String and binary types
+            REETestData::JSON(
+                utf8(), R"(["abc", "abc", "", "", "de", "de", "de", "ghijkl", 
"ghijkl"])",
+                R"(["abc", "", "de", "ghijkl"])", "[2, 4, 7, 9]"),

Review Comment:
   I was thinking something like:
   
   ```cpp
           std::shared_ptr<DataType> types[] = {binary(), large_binary(), 
utf8(), large_utf8()};
           for (auto binary_type : types) {
               REETestData::JSON(
                   binary_type,
                   R"(["abc", "abc", "", "", "de", "de", "de", "ghijkl", 
"ghijkl"])",
                   R"(["abc", "", "de", "ghijkl"])", "[2, 4, 7, 9]"),
               REETestData::JSON(
                   binary_type,
                   R"(["abc", "abc", "", "", "de", "de", "de", null, null, 
"ghijkl", "ghijkl"])",
                   R"(["abc", "", "de", null, "ghijkl"])", "[2, 4, 7, 9, 11]"),
           }
   ```
   
   So still pretty declarative.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to