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



##########
File path: java/core/src/java/org/apache/orc/impl/DictionaryUtils.java
##########
@@ -46,6 +47,18 @@ public static void getTextInternal(Text result, int position,
     byteArray.setText(result, offset, length);
   }
 
+  public static ByteBuffer getTextInternal(int position, DynamicIntArray 
keyOffsets,
+      DynamicByteArray byteArray) {
+    final int offset = keyOffsets.get(position);
+    final int length;
+    if (position + 1 == keyOffsets.size()) {
+      length = byteArray.size() - offset;
+    } else {
+      length = keyOffsets.get(position + 1) - offset;
+    }

Review comment:
       If you'd like to open a separate ticket to re-design this a bit more, 
please do.  I actually think this `DictionaryUtils` class can probably be 
removed and roll the functionality into `StringHashTable` directly.  But again, 
that's for another PR.




-- 
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-unsubscr...@orc.apache.org

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


Reply via email to