Adar Dembo has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/14644 )

Change subject: [cfile] Improve the hash function of pair<DataType, 
EncodingType>
......................................................................


Patch Set 2:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/14644/2//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/14644/2//COMMIT_MSG@13
PS2, Line 13: For example, the hash values of <UINT32=4, BIT_SHUFFLE=6>
            : and <INT32=5, PLAIN_ENCODING=1> are both equal to `100101`
> May be I'm missing something obvious, but I'm afraid I don't see collision.
The '^' in this case is XOR, not pow(x,y).

(4+31) ^ 6: 37
(5+31) ^ 1: 37

It's a little weird to use base10 representation though; the base2 
representation is 100101 as Lingbin wrote.


http://gerrit.cloudera.org:8080/#/c/14644/2/src/kudu/cfile/type_encodings.cc
File src/kudu/cfile/type_encodings.cc:

http://gerrit.cloudera.org:8080/#/c/14644/2/src/kudu/cfile/type_encodings.cc@208
PS2, Line 208:     return (pair.first << 5) + pair.second;
gutil/hash/hash.h defines a hash functor for pairs; maybe use that?



--
To view, visit http://gerrit.cloudera.org:8080/14644
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id141c51147ae674b9bee3016026a0b91cb76b5aa
Gerrit-Change-Number: 14644
Gerrit-PatchSet: 2
Gerrit-Owner: Anonymous Coward <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Bankim Bhavsar <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 07 Nov 2019 00:50:13 +0000
Gerrit-HasComments: Yes

Reply via email to