Skip to content

Commit

Permalink
Only hash array data bitmaps if the null count is not 0
Browse files Browse the repository at this point in the history
  • Loading branch information
micah-white committed May 9, 2023
1 parent 0ba89bf commit 2c167e6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cpp/src/arrow/scalar.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
// We can't visit values without unboxing the whole array, so only hash
// the null bitmap for now.
// the null bitmap for now. Only hash the null bitmap if the null count
// is 0 to ensure hash consistency.
RETURN_NOT_OK(BufferHash(*a.buffers[0]));
}
for (const auto& child : a.child_data) {
Expand Down

0 comments on commit 2c167e6

Please sign in to comment.