morrySnow commented on code in PR #49416:
URL: https://github.com/apache/doris/pull/49416#discussion_r2009935939
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/Literal.java:
##########
@@ -261,8 +261,14 @@ protected Expression uncheckedCastTo(DataType targetType)
throws AnalysisExcepti
return new CharLiteral(desc, ((CharType) targetType).getLen());
}
} else if (targetType.isVarcharType()) {
+ if (this.dataType.isDoubleType()) {
Review Comment:
should also fix float type
##########
regression-test/suites/nereids_p0/expression/fold_constant/fold_constant_string_arithmatic.groovy:
##########
@@ -1723,5 +1723,9 @@ suite("fold_constant_string_arithmatic") {
testFoldConst("select split_by_string('a😁a😁a', '')")
testFoldConst("select character_length('a😁a😁a')")
testFoldConst("select replace_empty('a😁a😁a', '', '2')")
+
+ // bug_fix
+ testFoldConst("select concat(substr('2025-03-20',1,4)-1,'-01-01')")
+ testFoldConst("select cast(2025.00 as string)")
Review Comment:
this test decimal type, not double
--
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]