From 05d1f4f71d868446956182be5773b1cb4fd847a9 Mon Sep 17 00:00:00 2001 From: Xinyi Zou Date: Sat, 6 Jan 2024 02:08:40 +0800 Subject: [PATCH] [fix](planner) Fix table sample not take effect (#29594) Modify computeSampleTabletIds location. table sample not take effect because selectedIndexId=-1 in computeSampleTabletIds, the previous run FE UT had special processing, so FE UT did not discover the BUG in time. --- .../nereids/glue/translator/PhysicalPlanTranslator.java | 1 - .../main/java/org/apache/doris/planner/OlapScanNode.java | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) 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);