BiteTheDDDDt commented on code in PR #33454: URL: https://github.com/apache/doris/pull/33454#discussion_r1560494718
########## fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/mv/SelectMaterializedIndexWithAggregate.java: ########## @@ -829,15 +832,16 @@ public PreAggStatus visitHllUnion(HllUnion hllUnion, CheckContext context) { private PreAggStatus checkAggFunc( AggregateFunction aggFunc, AggregateType matchingAggType, - CheckContext ctx) { + CheckContext ctx, + boolean canUseKeyColumn) { String childNameWithFuncName = ctx.isBaseIndex() ? normalizeName(aggFunc.child(0).toSql()) : normalizeName(CreateMaterializedViewStmt.mvColumnBuilder( matchingAggType, normalizeName(aggFunc.child(0).toSql()))); boolean contains = containsAllColumn(aggFunc.child(0), ctx.keyNameToColumn.keySet()); if (contains || ctx.keyNameToColumn.containsKey(childNameWithFuncName)) { - if (ctx.isDupKeysOrMergeOnWrite || (!ctx.isBaseIndex() && contains)) { + if (canUseKeyColumn || ctx.isDupKeysOrMergeOnWrite || (!ctx.isBaseIndex() && contains)) { Review Comment: maybe we can use ctx.isBaseIndex() to replace canUseKeyColumn? -- 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-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org