morrySnow commented on code in PR #68134:
URL: https://github.com/apache/doris/pull/68134#discussion_r4043677936


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/types/DecimalV3Type.java:
##########
@@ -225,6 +226,20 @@ public boolean isInjectiveCastTo(DataType target) {
             DecimalV3Type decimalV3Type = (DecimalV3Type) target;
             return decimalV3Type.getRange() >= this.getRange() && 
decimalV3Type.getScale() >= this.getScale();
         }
+        // An integral target discards the fractional part, so it is injective 
only for scale zero.
+        // The strict range bound also leaves room for the asymmetric negative 
endpoint of a signed
+        // integer. Binary floating-point casts round, but adjacent values in 
a DECIMAL(P, S) domain
+        // remain distinguishable when P <= 7 for FLOAT or P <= 15 for DOUBLE. 
Those conservative
+        // decimal-digit limits hold for every scale, not just for integral 
decimals.
+        if (scale == 0 && target instanceof IntegralType) {

Review Comment:
   SimplifyAggGroupBy will be fixed in another PR



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to