mapleFU commented on code in PR #36740:
URL: https://github.com/apache/arrow/pull/36740#discussion_r1267033561
##########
cpp/src/arrow/compute/kernels/vector_run_end_encode.cc:
##########
@@ -254,7 +254,7 @@ struct RunEndEncodeExec {
return RunEndEncodeNullArray(TypeTraits<RunEndType>::type_singleton(),
ctx,
input_array, result);
} else {
- const bool has_validity_buffer = input_array.MayHaveNulls();
+ const bool has_validity_buffer = input_array.GetNullCount() > 0;
Review Comment:
So when it has validity buffer, and `values.null_count ==
kUnknownNullCount`, here `MayHaveNulls()` returns true.
However, when calling `RunEndEncodeImpl`, it will call
`PreallocateValuesArray`, and `PreallocateValuesArray` wil call
`ArrayData::Make`. If `null_count == 0`, `ArrayData::Make` finally removes
`validity_buffer`, which breaks the invariant?
--
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]