You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2021/11/08 11:32:15 UTC

[GitHub] [incubator-doris] BiteTheDDDDt commented on a change in pull request #7045: [Feature] make BinaryPredicate do not cast date to datetime/varchar

BiteTheDDDDt commented on a change in pull request #7045:
URL: https://github.com/apache/incubator-doris/pull/7045#discussion_r744638152



##########
File path: fe/fe-core/src/main/java/org/apache/doris/analysis/BinaryPredicate.java
##########
@@ -294,29 +291,39 @@ private Type getCmpType() throws AnalysisException {
             }
         }
 
-        if (canCompareDate(getChild(0).getType().getPrimitiveType(), getChild(1).getType().getPrimitiveType())) {
+        Type t1 = getChild(0).getType();
+        Type t2 = getChild(1).getType();
+
+        if(t1.getPrimitiveType() == PrimitiveType.DATE && t2.getPrimitiveType() == PrimitiveType.DATE) {
+            return Type.DATE;

Review comment:
       When t1=DATE t2=DATETIME, it should be return DATETIME.




-- 
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-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org