morrySnow commented on code in PR #14964: URL: https://github.com/apache/doris/pull/14964#discussion_r1059276593
########## fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Min.java: ########## @@ -32,15 +31,19 @@ import java.util.List; /** min agg function. */ -public class Min extends AggregateFunction implements UnaryExpression, PropagateNullable, CustomSignature, +public class Min extends NullableAggregateFunction implements UnaryExpression, CustomSignature, ForbiddenMetricTypeArguments { public Min(Expression child) { - super("min", child); + this(false, false, child); } public Min(boolean isDistinct, Expression arg) { - super("min", false, arg); + this(isDistinct, false, arg); + } + + public Min(boolean isDistinct, boolean isAlwaysNullable, Expression arg) { + super("min", isAlwaysNullable, isDistinct, arg); Review Comment: maybe all alwaysnullable constructor should be private ########## fe/fe-core/src/main/java/org/apache/doris/nereids/rules/analysis/FillUpMissingSlots.java: ########## @@ -171,6 +172,9 @@ public void resolve(Expression expression) { throw new AnalysisException("Aggregate functions in having clause can't be nested: " + expression.toSql() + "."); } + if (groupByExpressions.isEmpty() && expression instanceof NullableAggregateFunction) { + expression = ((NullableAggregateFunction) expression).withAlwaysNullable(true); + } Review Comment: chould we make a new rule to process nullable only? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org