rok commented on code in PR #50094:
URL: https://github.com/apache/arrow/pull/50094#discussion_r3355852525


##########
cpp/src/arrow/acero/hash_aggregate_test.cc:
##########
@@ -2157,6 +2157,43 @@ TEST_P(GroupBy, AnyAndAll) {
   }
 }
 
+TEST_P(GroupBy, AnyAllSlicedNullableBoolean) {
+  auto table = TableFromJSON(schema({field("any_arg", boolean()),
+                                     field("all_arg", boolean()), field("key", 
int64())}),
+                             {R"([
+    [true,  false, 99],
+    [false, true,  10],
+    [null,  null,  10]
+  ])"});
+  auto sliced = table->Slice(1);
+
+  // GH-50043: hash_any/hash_all should respect the slice offset.
+  // After Slice(1), any_arg=[false, null] and all_arg=[true, null].
+  for (bool use_threads : {true, false}) {
+    SCOPED_TRACE(use_threads ? "parallel/merged" : "serial");
+
+    ASSERT_OK_AND_ASSIGN(auto actual, 
GroupByTest({sliced->GetColumnByName("any_arg"),
+                                                   
sliced->GetColumnByName("all_arg")},
+                                                  
{sliced->GetColumnByName("key")},
+                                                  {
+                                                      {"hash_any", nullptr},
+                                                      {"hash_all", nullptr},
+                                                  },
+                                                  use_threads));
+    ValidateOutput(actual);
+
+    auto expected = ArrayFromJSON(struct_({
+                                      field("key_0", int64()),
+                                      field("hash_any", boolean()),
+                                      field("hash_all", boolean()),
+                                  }),
+                                  R"([
+      [10, false, true]
+    ])");

Review Comment:
   Another nit: you could define this outside of the for loop.



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