seawinde commented on code in PR #38367: URL: https://github.com/apache/doris/pull/38367#discussion_r1696235961
########## fe/fe-core/src/main/java/org/apache/doris/nereids/rules/exploration/mv/MaterializedViewUtils.java: ########## @@ -589,9 +589,15 @@ private SlotReference getContextPartitionColumn(IncrementCheckerContext context) private static boolean checkPartition(Collection<? extends Expression> expressionsToCheck, Plan plan, IncrementCheckerContext context) { NamedExpression partitionColumn = context.getMvPartitionColumn(); - for (Expression projectSlot : expressionsToCheck) { + + OUTER_CHECK: for (Expression projectSlot : expressionsToCheck) { if (projectSlot.isColumnFromTable() && projectSlot.equals(partitionColumn.toSlot())) { - continue; + if (!context.getPartitionExpression().isPresent()) { Review Comment: if `projectSlot.isColumnFromTable() && projectSlot.equals(partitionColumn.toSlot()) ` is true the partitionExpression in context is always right because line 667. the code is duplicated to line 667. if `return context.getMvPartitionColumn().isColumnFromTable();` at end. this can be removed. -- 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