davidradl commented on code in PR #26802:
URL: https://github.com/apache/flink/pull/26802#discussion_r2210624071


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/types/utils/ValueDataTypeConverter.java:
##########
@@ -122,16 +122,17 @@ private static DataType convertToBinaryType(byte[] bytes) 
{
     }
 
     private static DataType convertToDecimalType(BigDecimal decimal) {
-        final int precision = decimal.precision();
-        final int scale = decimal.scale();
+        int precision = decimal.precision();
+        int scale = decimal.scale();
         // let underlying layers check if precision and scale are supported
         if (scale < 0) {
             // negative scale is not supported, normalize it
-            return DataTypes.DECIMAL(precision - scale, 0);
-        }
-
-        if (scale > precision) {
-            return DataTypes.DECIMAL(precision + scale, scale);
+            precision -= scale;
+            scale = 0;
+        } else if (scale >= precision) {
+            // scale > precision: 0.011, 0.000

Review Comment:
   I m unsure what these 2 comments mean. I suggest you add more words to 
describe. 



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