diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java index da0a58f4f3..c82590940b 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/glue/translator/PhysicalPlanTranslator.java @@ -643,7 +643,6 @@ public class PhysicalPlanTranslator extends DefaultPlanVisitor selectedPartitionList = new ArrayList<>(); - if (FeConstants.runningUnitTest && selectedIndexId == -1) { - selectedIndexId = olapTable.getBaseIndexId(); - } + Preconditions.checkState(selectedIndexId != -1); for (Long partitionId : selectedPartitionIds) { final Partition partition = olapTable.getPartition(partitionId); final MaterializedIndex selectedIndex = partition.getIndex(selectedIndexId);