westonpace commented on code in PR #35522:
URL: https://github.com/apache/arrow/pull/35522#discussion_r1190235212


##########
cpp/src/arrow/scalar.cc:
##########
@@ -153,9 +153,10 @@ struct ScalarHashImpl {
 
   Status ArrayHash(const ArrayData& a) {
     RETURN_NOT_OK(StdHash(a.length) & StdHash(a.GetNullCount()));
-    if (a.buffers[0] != nullptr) {
+    if (a.GetNullCount() != 0 && a.buffers[0] != nullptr) {

Review Comment:
   IIRC, it's also possible that `a.buffers[0] == nullptr` if all the elements 
are valid.  Is it possible that we still get differing hashes in this case?
   
   * All elements valid and equal and validity bitmap present (would hash the 
validity bitmap)
   * All elements valid and equal and validity bitmap missing (would not hash 
the validity bitmap)



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