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

[GitHub] [doris] starocean999 commented on a diff in pull request #19926: [fix](DECIMALV3) Fix the error in DECIMALV3 when explicitly casting.

starocean999 commented on code in PR #19926:
URL: https://github.com/apache/doris/pull/19926#discussion_r1201578847


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/ArithmeticExpr.java:
##########
@@ -536,7 +536,7 @@ private void analyzeDecimalV3Op(Type t1, Type t2) throws AnalysisException {
     public void analyzeImpl(Analyzer analyzer) throws AnalysisException {
         if (VectorizedUtil.isVectorized()) {
             for (Expr child : children) {
-                if (child instanceof DecimalLiteral && child.getType().isDecimalV3()) {
+                if (child instanceof DecimalLiteral && child.getType().isDecimalV3() && !child.getIsCasted()) {
                     ((DecimalLiteral) child).tryToReduceType();

Review Comment:
   try sql `select 1.0000000 / cast(3 as DECIMALV3(1, 0));` seems this pr can't handle such case, IMO,`tryToReduceType()` method is ambiguous, it's not clear why need this function, is it possible to remove it? 



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