morrySnow commented on code in PR #25456: URL: https://github.com/apache/doris/pull/25456#discussion_r1363065454
########## fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PruneOlapScanPartition.java: ########## @@ -52,7 +52,12 @@ public Rule build() { OlapTable table = scan.getTable(); Set<String> partitionColumnNameSet = Utils.execWithReturnVal(table::getPartitionColumnNames); if (partitionColumnNameSet.isEmpty()) { - return filter; + return new LogicalFilter<>(filter.getConjuncts(), + scan.withSelectedPartitionIds(scan.getSelectedPartitionIds().stream() + .filter( + partitionId + -> table.getPartition(partitionId).hasData()) Review Comment: merge to one row -- 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