zclllyybb commented on code in PR #63144:
URL: https://github.com/apache/doris/pull/63144#discussion_r3267716241


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/TimestampTzLiteral.java:
##########
@@ -168,6 +174,15 @@ protected Expression uncheckedCastTo(DataType targetType) 
throws AnalysisExcepti
         if (targetType.isTimeStampTzType()) {
             return new TimestampTzLiteral((TimeStampTzType) targetType,
                     year, month, day, hour, minute, second, microSecond);
+        } else if (targetType.isCharType()) {
+            String desc = getStringValueInSessionTimeZone();
+            if (((CharType) targetType).getLen() >= desc.length()) {
+                return new CharLiteral(desc, ((CharType) targetType).getLen());
+            }
+        } else if (targetType.isVarcharType()) {
+            return new VarcharLiteral(getStringValueInSessionTimeZone(), 
((VarcharType) targetType).getLen());

Review Comment:
   uncheckedCastToString#Literal.java also dont check for varchar. only char 
checks. but I make the code same by directly use 
uncheckedCastToString#Literal.java and override `castValueToString`



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