lidavidm commented on code in PR #37942:
URL: https://github.com/apache/arrow/pull/37942#discussion_r1340586618


##########
java/vector/src/main/java/org/apache/arrow/vector/util/DecimalUtility.java:
##########
@@ -89,13 +89,29 @@ public static byte[] getByteArrayFromArrowBuf(ArrowBuf 
bytebuf, int index, int b
    * thrown, otherwise returns true.
    */
   public static boolean checkPrecisionAndScale(BigDecimal value, int 
vectorPrecision, int vectorScale) {
+    return checkPrecisionAndScale(value, vectorPrecision, vectorScale, true);
+  }
+
+  /**
+   * Check that the BigDecimal scale equals the vectorScale and that the 
BigDecimal precision is
+   * less than or equal to the vectorPrecision. If not, then either ann 
UnsupportedOperationException is
+   * thrown or false is returned if depending on the shouldThrow parameter, 
otherwise returns true.
+   */
+  public static boolean checkPrecisionAndScale(BigDecimal value, int 
vectorPrecision, int vectorScale,
+                                               boolean shouldThrow) {

Review Comment:
   `shouldThrow` is a bit of an awkward API; it seems like there's not that 
much logic here, and we could just duplicate it? 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to