Skip to content

Commit 1016464

Browse files
starocean999pull[bot]
authored andcommitted
[fix](planner) fix bug of push down conjuncts through agg (#22202)
should use both contains and comeFrom method to check if the conjunct can be pushed down throgh agg node
1 parent bd2bd33 commit 1016464

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎fe/fe-core/src/main/java/org/apache/doris/analysis/DateLiteral.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ public DateLiteral(long unixTimestamp, TimeZone timeZone, Type type) throws Anal
261261
} else {
262262
throw new AnalysisException("Error date literal type : " + type);
263263
}
264+
analysisDone();
264265
}
265266

266267
public DateLiteral(long year, long month, long day) {
@@ -271,6 +272,7 @@ public DateLiteral(long year, long month, long day) {
271272
this.month = month;
272273
this.day = day;
273274
this.type = ScalarType.getDefaultDateType(Type.DATE);
275+
analysisDone();
274276
}
275277

276278
public DateLiteral(long year, long month, long day, Type type) {
@@ -280,6 +282,7 @@ public DateLiteral(long year, long month, long day, Type type) {
280282
Preconditions.checkArgument(type.getPrimitiveType().equals(Type.DATE.getPrimitiveType())
281283
|| type.getPrimitiveType().equals(Type.DATEV2.getPrimitiveType()));
282284
this.type = type;
285+
analysisDone();
283286
}
284287

285288
public DateLiteral(long year, long month, long day, long hour, long minute, long second) {
@@ -290,6 +293,7 @@ public DateLiteral(long year, long month, long day, long hour, long minute, long
290293
this.month = month;
291294
this.day = day;
292295
this.type = ScalarType.getDefaultDateType(Type.DATETIME);
296+
analysisDone();
293297
}
294298

295299
public DateLiteral(long year, long month, long day, long hour, long minute, long second, long microsecond,
@@ -303,6 +307,7 @@ public DateLiteral(long year, long month, long day, long hour, long minute, long
303307
this.microsecond = microsecond;
304308
Preconditions.checkArgument(type.isDatetimeV2());
305309
this.type = type;
310+
analysisDone();
306311
}
307312

308313
public DateLiteral(long year, long month, long day, long hour, long minute, long second, Type type) {
@@ -315,6 +320,7 @@ public DateLiteral(long year, long month, long day, long hour, long minute, long
315320
Preconditions.checkArgument(type.getPrimitiveType().equals(Type.DATETIME.getPrimitiveType())
316321
|| type.getPrimitiveType().equals(Type.DATETIMEV2.getPrimitiveType()));
317322
this.type = type;
323+
analysisDone();
318324
}
319325

320326
public DateLiteral(LocalDateTime dateTime, Type type) {
@@ -328,6 +334,7 @@ public DateLiteral(LocalDateTime dateTime, Type type) {
328334
this.second = dateTime.getSecond();
329335
this.microsecond = dateTime.get(ChronoField.MICRO_OF_SECOND);
330336
}
337+
analysisDone();
331338
}
332339

333340
public DateLiteral(DateLiteral other) {

‎fe/fe-core/src/main/java/org/apache/doris/planner/SingleNodePlanner.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2794,7 +2794,7 @@ private List<Expr> getPredicatesBoundedByGroupbysSourceExpr(
27942794
GroupByClause groupByClause = stmt.getGroupByClause();
27952795
List<Expr> exprs = groupByClause.getGroupingExprs();
27962796
final Expr srcExpr = sourceExpr;
2797-
if (!exprs.stream().anyMatch(expr -> expr.comeFrom(srcExpr))) {
2797+
if (!exprs.contains(srcExpr) && !exprs.stream().anyMatch(expr -> expr.comeFrom(srcExpr))) {
27982798
// the sourceExpr doesn't come from any of the group by exprs
27992799
isAllSlotReferToGroupBys = false;
28002800
break;

0 commit comments

Comments
 (0)