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


##########
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:
   When we execute natively, I think `useDecimal128` will always be true, so 
this won't currently improve performance?
   
   ```
           // Switch to use Decimal128 regardless of precision, since Arrow 
native execution
           // doesn't support Decimal32 and Decimal64 yet.
           SQLConf.get.setConfString(CometConf.COMET_USE_DECIMAL_128.key, 
"true")
   ```



-- 
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