tombentley commented on a change in pull request #11384:
URL: https://github.com/apache/kafka/pull/11384#discussion_r723930788



##########
File path: connect/api/src/main/java/org/apache/kafka/connect/data/Decimal.java
##########
@@ -64,8 +64,14 @@ public static Schema schema(int scale) {
      * @return the encoded value
      */
     public static byte[] fromLogical(Schema schema, BigDecimal value) {
-        if (value.scale() != scale(schema))
-            throw new DataException("BigDecimal has mismatching scale value 
for given Decimal schema");
+        int schemaScale = scale(schema);
+        if (value.scale() != schemaScale)
+            throw new DataException(String.format(
+                "BigDecimal has mismatching scale value for given Decimal 
schema. "

Review comment:
       Do we really want to mention `BigDecimal` here (it's really an 
implementation detail)? All the user needs to know is that the scale present in 
the value differs from the scale specified in the schema.




-- 
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: jira-unsubscr...@kafka.apache.org

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


Reply via email to