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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/literal/VarcharLiteral.java:
##########
@@ -63,4 +67,28 @@ public LiteralExpr toLegacyLiteral() {
     public String toString() {
         return "'" + value + "'";
     }
+
+    @Override
+    protected Expression uncheckedCastTo(DataType targetType) throws 
AnalysisException {
+        if (getDataType().equals(targetType)) {
+            return this;
+        }
+        if (targetType.isDateType()) {
+            return convertToDate(targetType);
+        } else if (targetType.isIntType()) {
+            return new IntegerLiteral(Integer.parseInt(value));
+        }
+        //todo other target type cast

Review Comment:
   remove this TODO, and add a comment to this function: temporary way to 
process type coercion in TimestampArithmetic, should be replaced by 
TypeCoercion rule.



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