morrySnow commented on code in PR #27893:
URL: https://github.com/apache/doris/pull/27893#discussion_r1412053912
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PruneOlapScanPartition.java:
##########
@@ -66,15 +68,21 @@ public Rule build() {
.stream()
.map(column ->
scanOutput.get(column.getName().toLowerCase()))
.collect(Collectors.toList());
+ List<Long> manuallySpecifiedPartitions =
scan.getManuallySpecifiedPartitions();
+ Map<Long, PartitionItem> idToPartitions;
+ if (manuallySpecifiedPartitions.isEmpty()) {
+ idToPartitions = partitionInfo.getIdToItem(false);
+ } else {
+ Map<Long, PartitionItem> allPartitions =
partitionInfo.getAllPartitions();
+ idToPartitions = allPartitions.keySet().stream()
+ .filter(id -> manuallySpecifiedPartitions.contains(id))
Review Comment:
we should pass isTemporary to here, because if user specify temporary
partition manually, we should not select same name partition. for example:
```sql
select * from t temporary partitions(t1);
```
if t has partition t1, we should not select it.
if t has temporary partition t1, we should select it.
--
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]