[fix](planner) let OlapScanNode turn off preaggragation when there is a filter on DELETE_SIGN (#12118)

We can skip aggregate on replace column, otherwise it would generate
wrong result. e.g. a row in UNIQUE is deleted by delte_sign_column,
then it would be returned.
This commit is contained in:
Yongqiang YANG
2022-08-30 15:54:37 +08:00
committed by GitHub
parent eea756fd5b
commit fb27e3ef31
5 changed files with 173 additions and 1 deletions

View File

@ -171,7 +171,8 @@ public class OlapScanNode extends ScanNode {
public void setIsPreAggregation(boolean isPreAggregation, String reason) {
this.isPreAggregation = isPreAggregation;
this.reasonOfPreAggregation = reason;
this.reasonOfPreAggregation = this.reasonOfPreAggregation == null ? reason :
this.reasonOfPreAggregation + " " + reason;
}
public boolean isPreAggregation() {
@ -1044,6 +1045,9 @@ public class OlapScanNode extends ScanNode {
Expr conjunct = new BinaryPredicate(BinaryPredicate.Operator.EQ, deleteSignSlot, new IntLiteral(0));
conjunct.analyze(analyzer);
conjuncts.add(conjunct);
if (!olapTable.getEnableUniqueKeyMergeOnWrite()) {
closePreAggregation(Column.DELETE_SIGN + " is used as conjuncts.");
}
}
}