tadeja commented on code in PR #49908:
URL: https://github.com/apache/arrow/pull/49908#discussion_r3183425057
##########
cpp/src/arrow/compute/kernels/aggregate_test.cc:
##########
@@ -941,6 +941,13 @@ TYPED_TEST(TestCountKernel, SimpleCount) {
EXPECT_THAT(Count(*MakeScalar(ty, 1), all), ResultWith(Datum(int64_t(1))));
}
+TEST(TestCountKernel, RunEndEncodedNulls) {
+ auto input = ArrayFromJSON(int32(), "[1, null]");
+ ASSERT_OK_AND_ASSIGN(auto encoded, RunEndEncode(input));
+
+ ValidateCount(*encoded.make_array(), {1, 1});
Review Comment:
```suggestion
auto input = ArrayFromJSON(int32(), "[1, 1, null, null, null, 2, 2, 2,
null, 3]");
ASSERT_OK_AND_ASSIGN(auto encoded, RunEndEncode(input));
ValidateCount(*encoded.make_array(), {6, 4});
// Slice crosses run boundaries: logical [null, null, 2, 2, 2, null].
ValidateCount(*encoded.make_array()->Slice(3, 6), {3, 3});
```
Just a small suggestion from my end to make the test harder to break in the
future, if you'd like to consider it. Asymmetric `{6, 4}` covers `run_length()`
weighting (instead of symmetric `{1,1}`), and `Slice(3, 6)` covers
`values.offset` in `ree_util::LogicalNullCount`.
--
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]