Skip to content

Commit

Permalink
[date](fix) modify push-down predicate for datev1 type (#25781) (#25940)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel39 authored Oct 26, 2023
1 parent ae923f7 commit ad1248f
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 21 deletions.
5 changes: 0 additions & 5 deletions be/src/exprs/bloom_filter_func.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
}
Expand Down
6 changes: 0 additions & 6 deletions be/src/vec/exec/scan/vscan_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,13 @@ 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;
}
if (slot->type().is_array_type()) {
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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ private static Expression processComparisonPredicateDateTimeV2Literal(
}

private Expression processDateLikeTypeCoercion(ComparisonPredicate cp, Expression left, Expression right) {
Expression originalRight = right;
if (left instanceof DateLiteral) {
cp = cp.commute();
Expression temp = left;
Expand Down Expand Up @@ -197,15 +196,6 @@ private Expression processDateLikeTypeCoercion(ComparisonPredicate cp, Expressio
}
}

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 {
Expand Down

0 comments on commit ad1248f

Please sign in to comment.