You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "westonpace (via GitHub)" <gi...@apache.org> on 2023/05/10 17:55:25 UTC

[GitHub] [arrow] westonpace commented on a diff in pull request #35522: GH-35521: [C++] Hash null bitmap only if null count is 0

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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org