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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/types/DecimalV3Type.java:
##########
@@ -218,13 +219,29 @@ private static DataType widerDecimalV3Type(
     @Override
     public boolean isInjectiveCastTo(DataType target) {
         if (target instanceof DecimalV2Type) {
-            DecimalV2Type decimalV2Type = (DecimalV2Type) target;
-            return decimalV2Type.getRange() >= this.getRange() && 
decimalV2Type.getScale() >= this.getScale();
+            // BE evaluates every DECIMALV2 target as DECIMAL(27, 9); its 
declared schema
+            // precision and scale do not restrict values produced by 
expression evaluation.
+            return DecimalV2Type.EXECUTION_RANGE >= getRange()

Review Comment:
   Fixed in b0390d70c80. Because DECIMALV2 is deprecated and FE/BE cast support 
is not uniform, every cast involving DECIMALV2 is now conservatively classified 
as non-injective, including nested MAP/ARRAY/STRUCT children. Cast.castNullable 
still uses the execution-domain constants for nullable semantics.



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