You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@orc.apache.org by GitBox <gi...@apache.org> on 2021/07/26 13:09:46 UTC

[GitHub] [orc] belugabehr commented on a change in pull request #748: ORC-842: Remove newKey from StringHashTableDictionary

belugabehr commented on a change in pull request #748:
URL: https://github.com/apache/orc/pull/748#discussion_r676587892



##########
File path: java/core/src/java/org/apache/orc/impl/StringHashTableDictionary.java
##########
@@ -173,10 +170,18 @@ public int size() {
 
   /**
    * Compute the hash value and find the corresponding index.
-   *
    */
   int getIndex(Text text) {
-    return Math.floorMod(text.hashCode(), capacity);
+    return getIndex(text.getBytes(), 0, text.getLength());
+  }
+
+  /**
+   * Compute the hash value and find the corresponding index. Uses same
+   * implementation as {@code Text#hashCode()}.
+   */
+  int getIndex(final byte[] bytes, final int offset, final int length) {
+    return Math.floorMod(WritableComparator.hashBytes(bytes, offset, length),

Review comment:
       I am happy to sub this out with non-hadoop hashcode if you would like.  Like I said, I came up with this only to preserve the previous behavior.




-- 
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: dev-unsubscribe@orc.apache.org

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