diff --git a/fe/src/main/java/org/apache/doris/planner/OlapScanNode.java b/fe/src/main/java/org/apache/doris/planner/OlapScanNode.java index 225b6965c7..153949eaba 100644 --- a/fe/src/main/java/org/apache/doris/planner/OlapScanNode.java +++ b/fe/src/main/java/org/apache/doris/planner/OlapScanNode.java @@ -443,6 +443,13 @@ public class OlapScanNode extends ScanNode { localBeId = Catalog.getCurrentSystemInfo().getBackendIdByHost(FrontendOptions.getLocalHostAddress()); } + /** + * Reset the tablet and scan range info before compute it. + * The old rollup selector has computed tablet and scan range info. + * Then the new mv selector maybe compute tablet and scan range info again sometimes. + * So, we need to reset those info in here. + */ + resetTabletAndScanRangeInfo(); for (Long partitionId : selectedPartitionIds) { final Partition partition = olapTable.getPartition(partitionId); final MaterializedIndex selectedTable = partition.getIndex(selectedIndexId); @@ -471,6 +478,17 @@ public class OlapScanNode extends ScanNode { } } + private void resetTabletAndScanRangeInfo() { + scanTabletIds = Lists.newArrayList(); + tabletId2BucketSeq = Maps.newHashMap(); + bucketSeq2locations = ArrayListMultimap.create(); + totalTabletsNum = 0; + selectedTabletsNum = 0; + cardinality = 0; + totalBytes = 0; + result = Lists.newArrayList(); + } + /** * We query Palo Meta to get request's data location * extra result info will pass to backend ScanNode