[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.
This commit is contained in:
@ -643,7 +643,6 @@ public class PhysicalPlanTranslator extends DefaultPlanVisitor<PlanFragment, Pla
|
||||
if (olapScan.getTableSample().isPresent()) {
|
||||
olapScanNode.setTableSample(new TableSample(olapScan.getTableSample().get().isPercent,
|
||||
olapScan.getTableSample().get().sampleValue, olapScan.getTableSample().get().seek));
|
||||
olapScanNode.computeSampleTabletIds();
|
||||
}
|
||||
|
||||
// TODO: remove this switch?
|
||||
|
||||
@ -555,7 +555,6 @@ public class OlapScanNode extends ScanNode {
|
||||
computePartitionInfo();
|
||||
}
|
||||
computeTupleState(analyzer);
|
||||
computeSampleTabletIds();
|
||||
|
||||
/**
|
||||
* Compute InAccurate cardinality before mv selector and tablet pruning.
|
||||
@ -949,6 +948,7 @@ public class OlapScanNode extends ScanNode {
|
||||
Preconditions.checkState(selectedIndexId != -1);
|
||||
// compute tablet info by selected index id and selected partition ids
|
||||
long start = System.currentTimeMillis();
|
||||
computeSampleTabletIds();
|
||||
computeTabletInfo();
|
||||
LOG.debug("distribution prune cost: {} ms", (System.currentTimeMillis() - start));
|
||||
}
|
||||
@ -971,9 +971,7 @@ public class OlapScanNode extends ScanNode {
|
||||
long selectedRows = 0;
|
||||
long totalSampleRows = 0;
|
||||
List<Long> 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);
|
||||
|
||||
Reference in New Issue
Block a user