morrySnow commented on code in PR #65319:
URL: https://github.com/apache/doris/pull/65319#discussion_r3577124324


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/StringLikeLiteral.java:
##########
@@ -385,10 +361,30 @@ protected DateTimeV2Literal getDateTimeLiteral(String 
year, String month, String
             }
         }
         String format = String.format("%s-%s-%sT%s:%s:%s%s%s", year4, month, 
date, hour, minute, second, fraction, tz);
-        try {
-            return new DateTimeV2Literal((DateTimeV2Type) targetType, format);
-        } catch (AnalysisException e) {
-            throw new CastException(e.getMessage(), e);
+        if (targetType.isDateType()) {
+            try {
+                return new DateLiteral(format);
+            } catch (AnalysisException e) {
+                throw new CastException(e.getMessage(), e);
+            }
+        } else if (targetType.isDateV2Type()) {
+            try {
+                return new DateV2Literal(format);
+            } catch (AnalysisException e) {
+                throw new CastException(e.getMessage(), e);
+            }
+        } else if (targetType.isDateTimeType()) {
+            try {
+                return new DateTimeLiteral(format);

Review Comment:
   fixed



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