felipecrv commented on code in PR #36740:
URL: https://github.com/apache/arrow/pull/36740#discussion_r1266871238


##########
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:
   @mapleFU this is the fix to the issue. `MayHaveNulls` was returning `true` 
here because the validity bitmap exists, but down the road, when the REE is 
allocated, validity buffer was assumed to also exist in the allocated output. 
When, in fact, it didn't actually exist because `null_count == 0` gets that 
buffer cleared.



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