nextdreamblue commented on code in PR #12877:
URL: https://github.com/apache/doris/pull/12877#discussion_r984287127


##########
fe/fe-core/src/main/java/org/apache/doris/analysis/CastExpr.java:
##########
@@ -412,7 +412,7 @@ private Expr castTo(LiteralExpr value) throws 
AnalysisException {
         } else if (type.isLargeIntType()) {
             return new LargeIntLiteral(value.getStringValue());
         } else if (type.isDecimalV2() || type.isDecimalV3()) {
-            return new DecimalLiteral(value.getStringValue());

Review Comment:
   如果是-1,就和原来一样,在新的DecimalLiteral里,只有用户输入的scale大于等于0时,才去按真实的精度来处理
   if (scale >= 0) {
             v = v.setScale(scale, RoundingMode.DOWN);
   }



##########
fe/fe-core/src/main/java/org/apache/doris/analysis/CastExpr.java:
##########
@@ -412,7 +412,7 @@ private Expr castTo(LiteralExpr value) throws 
AnalysisException {
         } else if (type.isLargeIntType()) {
             return new LargeIntLiteral(value.getStringValue());
         } else if (type.isDecimalV2() || type.isDecimalV3()) {
-            return new DecimalLiteral(value.getStringValue());

Review Comment:
   如果是-1,就和原来一样,在新的DecimalLiteral里,只有用户输入的scale大于等于0时,才去按真实的精度来处理
   if (scale >= 0) {
   v = v.setScale(scale, RoundingMode.DOWN);
   }



-- 
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-unsubscr...@doris.apache.org

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


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

Reply via email to