You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/12/29 08:12:18 UTC

[GitHub] [doris] HappenLee commented on a diff in pull request #15463: [Improvement](decimalv3) Add a config to check overflow for DECIMALV3

HappenLee commented on code in PR #15463:
URL: https://github.com/apache/doris/pull/15463#discussion_r1058800717


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/Expr.java:
##########
@@ -2036,6 +2038,27 @@ private boolean customNullableAlgorithm() {
         if (fn.functionName().equalsIgnoreCase("concat_ws")) {
             return children.get(0).isNullable();
         }
+        if (fn.functionName().equalsIgnoreCase(Operator.MULTIPLY.getName())
+                && fn.getReturnType().isDecimalV3()) {
+            if ((children.get(0).getType().getPrecision() + children.get(1).getType().getPrecision()
+                    > ScalarType.MAX_PRECISION || !children.get(0).getType().isDecimalV3()
+                    || !children.get(1).getType().isDecimalV3()) && ConnectContext.get() != null
+                    && ConnectContext.get().getSessionVariable().checkOverflowForDecimal()) {
+                return true;

Review Comment:
   make sure the nullable type return same as BE,maybe coredump here



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