foxtail463 commented on code in PR #61345:
URL: https://github.com/apache/doris/pull/61345#discussion_r3264330269
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/Predicates.java:
##########
@@ -332,7 +332,7 @@ private static Map<Expression, ExpressionInfo>
collectResidualCandidates(StructI
queryStructInfo.getSplitPredicate().getResidualPredicateMap().keySet());
Map<Expression, ExpressionInfo> residualCandidates = new
LinkedHashMap<>();
for (Expression expression : expressions) {
- if (expression.anyMatch(AggregateFunction.class::isInstance)) {
+ if (ExpressionUtils.hasNonWindowAggregateFunction(expression)) {
Review Comment:
This change is intentional.
```sql
drop table if exists mv_window_agg_residual_t;
create table mv_window_agg_residual_t (
id int,
score int
)
duplicate key(id)
distributed by hash(id) buckets 1
properties ("replication_num" = "1");
insert into mv_window_agg_residual_t values
(1, 3),
(1, 8),
(2, 4);
drop materialized view if exists mv_window_agg_residual_mv;
create materialized view mv_window_agg_residual_mv
build immediate refresh complete on manual
distributed by hash(id) buckets 1
properties ("replication_num" = "1")
as
select id, score
from mv_window_agg_residual_t
qualify sum(score) over (partition by id) > 10;
-- 这个 query 应该匹配上 mv_window_agg_residual_mv
select id, score
from mv_window_agg_residual_t
qualify sum(score) over (partition by id) > 10;
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]