englefly commented on code in PR #15949:
URL: https://github.com/apache/doris/pull/15949#discussion_r1080724336


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/Multiply.java:
##########
@@ -44,7 +45,11 @@ public Expression withChildren(List<Expression> children) {
 
     @Override
     public DataType getDataType() {
-        return left().getDataType().promotion();
+        DataType rightType = child(0).getDataType();
+        DataType leftType = child(1).getDataType();
+        DataType outputType = TypeCoercionUtils.findTightestCommonType(null,
+                rightType, leftType).orElseGet(() -> rightType);
+        return outputType;

Review Comment:
   we need refactor getDateType() for all functions



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