[fix](nereids)aggregate function cannot contain aggregate parameters (#30928)
This commit is contained in:
@ -17,6 +17,7 @@
|
||||
|
||||
package org.apache.doris.nereids.rules.analysis;
|
||||
|
||||
import org.apache.doris.nereids.exceptions.AnalysisException;
|
||||
import org.apache.doris.nereids.rules.Rule;
|
||||
import org.apache.doris.nereids.rules.RuleType;
|
||||
import org.apache.doris.nereids.rules.rewrite.NormalizeToSlot;
|
||||
@ -220,6 +221,11 @@ public class NormalizeAggregate implements RewriteRuleFactory, NormalizeToSlot {
|
||||
// normalize trival-aggs by bottomProjects
|
||||
List<AggregateFunction> normalizedAggFuncs =
|
||||
bottomSlotContext.normalizeToUseSlotRef(aggFuncs);
|
||||
if (normalizedAggFuncs.stream().anyMatch(agg -> !agg.children().isEmpty()
|
||||
&& agg.child(0).containsType(AggregateFunction.class))) {
|
||||
throw new AnalysisException(
|
||||
"aggregate function cannot contain aggregate parameters");
|
||||
}
|
||||
|
||||
// build normalized agg output
|
||||
NormalizeToSlotContext normalizedAggFuncsToSlotContext =
|
||||
|
||||
Reference in New Issue
Block a user