You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "morrySnow (via GitHub)" <gi...@apache.org> on 2023/06/09 06:58:47 UTC

[GitHub] [doris] morrySnow commented on a diff in pull request #20634: [fix](planner)the common type of floating and decimal should be floating type

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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/util/TypeCoercionUtils.java:
##########
@@ -1077,12 +1077,26 @@ protected static Optional<DataType> findCommonPrimitiveTypeForCaseWhen(DataType
             return Optional.empty();
         }
 
+        // decimalv3 and floating type
+        if (t1.isDecimalV3Type() || t2.isDecimalV3Type()) {
+            if (t1.isFloatType() || t2.isDoubleType() || t1.isDoubleType() || t2.isFloatType()) {
+                return t1.isDecimalV3Type() ? Optional.of(t2) : Optional.of(t1);
+            }
+        }

Review Comment:
   we need to select double or float according to decimal precision and scale



-- 
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: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org