felipecrv opened a new pull request, #36740:
URL: https://github.com/apache/arrow/pull/36740

   ### Rationale for this change
   
   When `has_validity_buffer` is true, we expect validity buffers to be
   allocated, but if null_count is calculated and ends up being 0,
   `ArrayData::Make()` will sneakily remove the validity buffer from
   the physical array for us and the assumption that it exists stops
   holding and causes a crash.
   
   Forcing `null_count` calculation with `input.GetNullCount()` ensures 
`has_validity_buffer` won't be `true` if the `null_count` on the input ends up 
being 0.
   
   ### What changes are included in this PR?
   
   The fix and tests to reproduce it.
   
   ### Are these changes tested?
   
   Yes.
   
   ### Are there any user-facing changes?
   
   No.


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