[fix](nereids) temp partition is always pruned (#27636)

This commit is contained in:
minghong
2023-11-28 14:18:14 +08:00
committed by GitHub
parent 31fe48111b
commit 2ea1e9db44
4 changed files with 46 additions and 1 deletions

View File

@ -129,6 +129,16 @@ public class PartitionInfo implements Writable {
}
}
/**
* @return both normal partition and temp partition
*/
public Map<Long, PartitionItem> getAllPartitions() {
HashMap all = new HashMap<>();
all.putAll(idToTempItem);
all.putAll(idToItem);
return all;
}
public PartitionItem getItem(long partitionId) {
PartitionItem item = idToItem.get(partitionId);
if (item == null) {

View File

@ -103,7 +103,7 @@ public class PartitionPruner extends DefaultExpressionRewriter<Void> {
*/
public static List<Long> prune(List<Slot> partitionSlots, Expression partitionPredicate,
PartitionInfo partitionInfo, CascadesContext cascadesContext, PartitionTableType partitionTableType) {
return prune(partitionSlots, partitionPredicate, partitionInfo.getIdToItem(false), cascadesContext,
return prune(partitionSlots, partitionPredicate, partitionInfo.getAllPartitions(), cascadesContext,
partitionTableType);
}