[fix](Nereids) set card to olap table break card block rule (#28417)
we have card block rule to avoid scan too many data. so we must set olap scan card by only scanned bucket.
This commit is contained in:
@ -588,7 +588,9 @@ public class PhysicalPlanTranslator extends DefaultPlanVisitor<PlanFragment, Pla
|
||||
OlapScanNode olapScanNode = new OlapScanNode(olapScan.translatePlanNodeId(), tupleDescriptor, "OlapScanNode");
|
||||
// TODO: move all node set cardinality into one place
|
||||
if (olapScan.getStats() != null) {
|
||||
olapScanNode.setCardinality((long) olapScan.getStats().getRowCount());
|
||||
// NOTICE: we should not set stats row count
|
||||
// because it is whole table cardinality and will break block rules.
|
||||
// olapScanNode.setCardinality((long) olapScan.getStats().getRowCount());
|
||||
if (context.getSessionVariable() != null && context.getSessionVariable().forbidUnknownColStats) {
|
||||
for (int i = 0; i < slots.size(); i++) {
|
||||
SlotReference slot = (SlotReference) slots.get(i);
|
||||
|
||||
@ -1628,6 +1628,8 @@ public class OlapScanNode extends ScanNode {
|
||||
public void finalizeForNereids() {
|
||||
computeNumNodes();
|
||||
computeStatsForNereids();
|
||||
// NOTICE: must call here to get selected tablet row count to let block rules work well.
|
||||
mockRowCountInStatistic();
|
||||
if (!SessionVariable.enablePipelineEngineX()) {
|
||||
// distributionColumnIds is used for one backend node agg optimization, nereids do not support it.
|
||||
distributionColumnIds.clear();
|
||||
|
||||
Reference in New Issue
Block a user