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


##########
common/src/main/java/org/apache/comet/vector/CometVector.java:
##########
@@ -89,6 +90,8 @@ public Decimal getDecimal(int i, int precision, int scale) {
       return createDecimal(getInt(i), precision, scale);
     } else if (!useDecimal128 && precision <= Decimal.MAX_LONG_DIGITS()) {
       return createDecimal(getLong(i), precision, scale);
+    } else if (useDecimal128 && precision <= Decimal.MAX_LONG_DIGITS()) {
+      return createDecimal(getLongFromDecimalBytes(getBinaryDecimal(i)), 
precision, scale);

Review Comment:
   nit: for readability, I think it is better not to repeat the `precision <= 
Decimal.MAX_LONG_DIGITS()` expression
   
   ```suggestion
       } else if (precision <= Decimal.MAX_LONG_DIGITS()) {
         if (useDecimal128) {
           return createDecimal(getLongFromDecimalBytes(getBinaryDecimal(i)), 
precision, scale);
         } else {
           return createDecimal(getLong(i), precision, scale);
   ```



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