Repository: kylin Updated Branches: refs/heads/master 3af27d688 -> 19e9582fd
bug fix Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/19e9582f Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/19e9582f Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/19e9582f Branch: refs/heads/master Commit: 19e9582fddd5bdabadb88e1a042b7874c11c38c6 Parents: 3af27d6 Author: Hongbin Ma <mahong...@apache.org> Authored: Wed Apr 20 17:15:43 2016 +0800 Committer: Hongbin Ma <mahong...@apache.org> Committed: Wed Apr 20 17:15:43 2016 +0800 ---------------------------------------------------------------------- .../src/main/java/org/apache/kylin/common/util/ByteArray.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/19e9582f/core-common/src/main/java/org/apache/kylin/common/util/ByteArray.java ---------------------------------------------------------------------- diff --git a/core-common/src/main/java/org/apache/kylin/common/util/ByteArray.java b/core-common/src/main/java/org/apache/kylin/common/util/ByteArray.java index 2288419..921d161 100644 --- a/core-common/src/main/java/org/apache/kylin/common/util/ByteArray.java +++ b/core-common/src/main/java/org/apache/kylin/common/util/ByteArray.java @@ -141,10 +141,10 @@ public class ByteArray implements Comparable<ByteArray>, Serializable { if (data == null) { return 0; } else { - if (length <= Bytes.SIZEOF_LONG) { + if (length <= Bytes.SIZEOF_LONG && length > 0) { //to avoid hash collision of byte arrays those are converted from nearby integers/longs, //which is the case for kylin dictionary - return Long.valueOf(Bytes.toLong(data, offset, length)).hashCode(); + return Long.valueOf(BytesUtil.readLong(data, offset, length)).hashCode(); } return Bytes.hashCode(data, offset, length); }