Joe McDonnell has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/20396


Change subject: IMPALA-12393: Fix inconsistent hash for TimestampValue in 
DictEncoder
......................................................................

IMPALA-12393: Fix inconsistent hash for TimestampValue in DictEncoder

Currently, DictEncoder uses the default hash policy for TimestampValue,
which means it is hashing the entire TimestampValue struct. This is
inconsistent, because TimestampValue contains some padding that is
not guaranteed to be zero.

This was discovered when fixing a Clang Tidy performance-for-range-copy
warning by iterating with a const reference rather than making a copy of
the value. DictTest.TestTimestamps became flaky with that change, because
the hash was no longer consistent. The copy must have had consistent content
for the padding through the iteration, but the const reference did not.

This adds a template specialization of the Hash function for TimestampValue.
The specialization uses TimestampValue::Hash(), which hashes only the 
non-padding
pieces of the struct. This includes the change to dict-test.cc that
uncovered the issue.

Testing:
 - Ran dict-test in a loop for a few hundred iterations

Change-Id: Iad86e9b0f645311c3389cf2804dcc1a346ff10a9
---
M be/src/util/dict-encoding.h
M be/src/util/dict-test.cc
2 files changed, 8 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/96/20396/1
--
To view, visit http://gerrit.cloudera.org:8080/20396
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad86e9b0f645311c3389cf2804dcc1a346ff10a9
Gerrit-Change-Number: 20396
Gerrit-PatchSet: 1
Gerrit-Owner: Joe McDonnell <[email protected]>

Reply via email to