airborne12 commented on code in PR #41127:
URL: https://github.com/apache/doris/pull/41127#discussion_r1770892332
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/AggregateStrategies.java:
##########
@@ -136,7 +137,8 @@ public List<Rule> buildRules() {
.when(agg -> agg.getGroupByExpressions().isEmpty())
.when(agg -> {
Set<AggregateFunction> funcs =
agg.getAggregateFunctions();
- return !funcs.isEmpty() && funcs.stream().allMatch(f
-> f instanceof Count && !f.isDistinct());
+ return !funcs.isEmpty() && funcs.stream().allMatch(f
-> f instanceof Count && !f.isDistinct()
+ && (((Count) f).isCountStar() || f.child(0)
instanceof Slot));
Review Comment:
```
public boolean isCountStar() {
return isStar
|| children.isEmpty()
|| (children.size() == 1 && child(0) instanceof Literal);
}
```
isCountStar already included.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]