EmmyMiao87 commented on a change in pull request #5987:
URL: https://github.com/apache/incubator-doris/pull/5987#discussion_r647944717



##########
File path: 
fe/fe-core/src/main/java/org/apache/doris/rewrite/SimplifyInvalidDateBinaryPredicatesDateRule.java
##########
@@ -50,13 +52,29 @@ public Expr apply(Expr expr, Analyzer analyzer) throws 
AnalysisException {
         if (!valueExpr.isConstant()) {
             return expr;
         }
+
+        // This is not a very good implementation and tricky.
+        // We have to handle the following cases:
+        // A. k1 is datetime, sql with "k1 > to_date(now())" will be converted 
to k1 > cast(to_date("xxxx-xx-xx"))
+        // B. k1 is datetime, sql with "k1 > '2021-10-32 10:00:00.100010'" 
will be converted to k1 > cast('2021-10-32 10:00:00.100010' as datetime)
+        // C. k1 is datetime, sql with "k1 > '2021-10-32'" will be converted 
to k1 > cast('2021-10-32' as datetime)

Review comment:
       converted to null literal




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

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