liuyongvs commented on code in PR #25404:
URL: https://github.com/apache/flink/pull/25404#discussion_r1778461405


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/ValueDataTypeConverter.java:
##########
@@ -126,6 +126,10 @@ private static DataType convertToDecimalType(BigDecimal 
decimal) {
             // negative scale is not supported, normalize it
             return DataTypes.DECIMAL(precision - scale, 0);
         }
+
+        if (scale > precision) {
+            return DataTypes.DECIMAL(precision + scale, scale);

Review Comment:
   it will not, for example 0.111 java BigDecimal precision is 3 and scale is 
also 3, will not throw eception @dylanhz 
   if we change to decimal(4,3) it will cause breaking change @dylanhz 



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