do not push down agg on aggregate column (#27356)
do not push down agg on aggregate column
This commit is contained in:
@ -436,11 +436,8 @@ public class AggregateStrategies implements ImplementationRuleFactory {
|
||||
|
||||
for (SlotReference slot : usedSlotInTable) {
|
||||
Column column = slot.getColumn().get();
|
||||
if (logicalScan instanceof LogicalOlapScan) {
|
||||
KeysType keysType = ((LogicalOlapScan) logicalScan).getTable().getKeysType();
|
||||
if (keysType == KeysType.AGG_KEYS && !column.isKey()) {
|
||||
return canNotPush;
|
||||
}
|
||||
if (column.isAggregated()) {
|
||||
return canNotPush;
|
||||
}
|
||||
// The zone map max length of CharFamily is 512, do not
|
||||
// over the length: https://github.com/apache/doris/pull/6293
|
||||
|
||||
@ -1668,6 +1668,13 @@ public class OlapScanNode extends ScanNode {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (aggExpr.getChild(0) instanceof SlotRef) {
|
||||
SlotRef slot = (SlotRef) aggExpr.getChild(0);
|
||||
if (CreateMaterializedViewStmt.isMVColumn(slot.getColumnName()) && slot.getColumn().isAggregated()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user