andygrove commented on code in PR #705:
URL: https://github.com/apache/datafusion-comet/pull/705#discussion_r1687282806


##########
common/src/main/java/org/apache/comet/vector/CometDictionary.java:
##########
@@ -100,17 +102,21 @@ public void close() {
   }
 
   private void initialize() {
-    switch (values.getValueVector().getMinorType()) {
+    ValueVector vector = values.getValueVector();
+    switch (vector.getMinorType()) {
       case DECIMAL:
-        // We only need to copy values for decimal type as random access
-        // to the dictionary is not efficient for decimal (it needs to copy
-        // the value to a new byte array everytime).
-        binaries = new ByteArrayWrapper[numValues];
-        for (int i = 0; i < numValues; i++) {
-          // Need copying here since we re-use byte array for decimal
-          byte[] bytes = new byte[DECIMAL_BYTE_WIDTH];
-          bytes = values.copyBinaryDecimal(i, bytes);
-          binaries[i] = new ByteArrayWrapper(bytes);
+        if (values.useDecimal128

Review Comment:
   useDecimal128 is hardcoded to true in this code in `importVector`.
   
   ```
         // Native execution should always have 'useDecimal128' set to true 
since it doesn't support
         // other cases.
         arrayVectors += CometVector.getVector(
           importer.importVector(arrowArray, arrowSchema, dictionaryProvider),
           true, // <-- useDecimal128
           dictionaryProvider)
   ```



-- 
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: github-unsubscr...@datafusion.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to