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


##########
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:
   make sense, precision must be greater than scale according to 
https://github.com/apache/flink/blob/6633719c728526a08344645e0a844f27d25629f4/flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/logical/DecimalType.java#L74



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