pitrou commented on code in PR #49964:
URL: https://github.com/apache/arrow/pull/49964#discussion_r3340834367


##########
python/pyarrow/tests/test_compute.py:
##########
@@ -1722,6 +1722,30 @@ def con(values):
     assert result.equals(con([False, True, True, None]))
 
 
+def test_equal_binary_view():

Review Comment:
   I'm not sure it's useful to add these tests on the Python side, since we're 
already exercising this in C++ tests.



##########
cpp/src/arrow/compute/kernels/scalar_compare_test.cc:
##########
@@ -1196,6 +1196,73 @@ TEST_F(TestStringCompareKernel, RandomCompareArrayArray) 
{
   }
 }
 
+TEST(TestBinaryViewCompareKernel, ArrayArray) {
+  const auto cases = std::vector<std::shared_ptr<DataType>>{binary_view(), 
utf8_view()};
+  const auto expected = std::vector<std::pair<std::string, std::string>>{
+      {"equal", "[true, false, false, false, false, false, null]"},
+      {"not_equal", "[false, true, true, true, true, true, null]"},
+      {"greater", "[false, false, false, false, false, true, null]"},
+      {"greater_equal", "[true, false, false, false, false, true, null]"},
+      {"less", "[false, true, true, true, true, false, null]"},
+      {"less_equal", "[true, true, true, true, true, false, null]"}};
+
+  for (const auto& ty : cases) {
+    auto lhs =
+        ArrayFromJSON(ty, R"(["", "abc", "abcdefghijkl", "abcdefghijklm", 
"prefix_same_A",
+                "samepref_size", null])");
+    auto rhs = ArrayFromJSON(
+        ty, R"(["", "abd", "abcdefghijklm", "abcdefghijklz", "prefix_same_B",
+                "samepref", null])");
+
+    CheckScalarBinary("equal", ArrayFromJSON(ty, R"([])"), ArrayFromJSON(ty, 
R"([])"),
+                      ArrayFromJSON(boolean(), R"([])"));
+    CheckScalarBinary("equal", ArrayFromJSON(ty, R"([null])"),
+                      ArrayFromJSON(ty, R"([null])"),
+                      ArrayFromJSON(boolean(), R"([null])"));
+    for (const auto& function_and_expected : expected) {
+      CheckScalarBinary(function_and_expected.first, lhs, rhs,
+                        ArrayFromJSON(boolean(), 
function_and_expected.second));
+    }
+  }
+}
+
+TEST(TestBinaryViewCompareKernel, SlicedArrays) {

Review Comment:
   `CheckScalarBinary` already checks sliced inputs, this test is not necessary.



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