This is an automated email from the ASF dual-hosted git repository.

kxiao pushed a commit to branch release-2.0.2.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/release-2.0.2.1 by this push:
     new ad1248f330c [date](fix) modify push-down predicate for datev1 type 
(#25781) (#25940)
ad1248f330c is described below

commit ad1248f330cd951477da58fd4309edca8597cbe0
Author: Gabriel <[email protected]>
AuthorDate: Thu Oct 26 19:54:33 2023 +0800

    [date](fix) modify push-down predicate for datev1 type (#25781) (#25940)
---
 be/src/exprs/bloom_filter_func.h                               |  5 -----
 be/src/vec/exec/scan/vscan_node.cpp                            |  6 ------
 .../rules/expression/rules/SimplifyComparisonPredicate.java    | 10 ----------
 3 files changed, 21 deletions(-)

diff --git a/be/src/exprs/bloom_filter_func.h b/be/src/exprs/bloom_filter_func.h
index 0a86a359902..330c939819c 100644
--- a/be/src/exprs/bloom_filter_func.h
+++ b/be/src/exprs/bloom_filter_func.h
@@ -434,11 +434,6 @@ struct DateFindOp : public 
CommonFindOp<vectorized::VecDateTimeValue> {
 
         vectorized::VecDateTimeValue date_value;
         date_value.from_olap_date(value);
-        // So confusing here. For join node with condition (a.date_col = 
b.date_col), the actual
-        // expression is CAST(a.date_col AS DATETIME) = CAST(b.date_col AS 
DATETIME). So we build
-        // this bloom filter by CAST(a.date_col AS DATETIME) and also need to 
probe this bloom
-        // filter by a datetime value.
-        date_value.set_type(TimeType::TIME_DATETIME);
 
         return bloom_filter.test(Slice((char*)&date_value, 
sizeof(vectorized::VecDateTimeValue)));
     }
diff --git a/be/src/vec/exec/scan/vscan_node.cpp 
b/be/src/vec/exec/scan/vscan_node.cpp
index 07c68d1b179..f825e596b22 100644
--- a/be/src/vec/exec/scan/vscan_node.cpp
+++ b/be/src/vec/exec/scan/vscan_node.cpp
@@ -76,9 +76,6 @@ namespace doris::vectorized {
     }
 
 static bool ignore_cast(SlotDescriptor* slot, VExpr* expr) {
-    if (slot->type().is_date_type() && expr->type().is_date_type()) {
-        return true;
-    }
     if (slot->type().is_string_type() && expr->type().is_string_type()) {
         return true;
     }
@@ -86,9 +83,6 @@ static bool ignore_cast(SlotDescriptor* slot, VExpr* expr) {
         if (slot->type().children[0].type == expr->type().type) {
             return true;
         }
-        if (slot->type().children[0].is_date_type() && 
expr->type().is_date_type()) {
-            return true;
-        }
         if (slot->type().children[0].is_string_type() && 
expr->type().is_string_type()) {
             return true;
         }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/SimplifyComparisonPredicate.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/SimplifyComparisonPredicate.java
index 19574f8f16e..614483a270c 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/SimplifyComparisonPredicate.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rules/SimplifyComparisonPredicate.java
@@ -146,7 +146,6 @@ public class SimplifyComparisonPredicate extends 
AbstractExpressionRewriteRule {
     }
 
     private Expression processDateLikeTypeCoercion(ComparisonPredicate cp, 
Expression left, Expression right) {
-        Expression originalRight = right;
         if (left instanceof DateLiteral) {
             cp = cp.commute();
             Expression temp = left;
@@ -197,15 +196,6 @@ public class SimplifyComparisonPredicate extends 
AbstractExpressionRewriteRule {
             }
         }
 
-        if (left.getDataType() == DateType.INSTANCE && right.getDataType() == 
DateType.INSTANCE) {
-            //Date cp Date is not supported in BE storage engine. So cast to 
DateTime
-            left = new Cast(left, DateTimeType.INSTANCE);
-            if (right instanceof DateLiteral) {
-                right = migrateLiteralToDateTime((DateLiteral) originalRight);
-            } else {
-                right = new Cast(originalRight, DateTimeType.INSTANCE);
-            }
-        }
         if (left != cp.left() || right != cp.right()) {
             return cp.withChildren(left, right);
         } else {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to