yujun777 commented on code in PR #62548:
URL: https://github.com/apache/doris/pull/62548#discussion_r3092268055


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Count.java:
##########
@@ -77,7 +77,7 @@ private Count(boolean isStar, AggregateFunctionParams 
functionParams) {
     public boolean isCountStar() {
         return isStar
                 || children.isEmpty()
-                || (children.size() == 1 && child(0) instanceof Literal);
+                || (children.size() == 1 && child(0) instanceof Literal && 
!child(0).isNullLiteral());

Review Comment:
   Fixed. Added a direct FE plan test `testCountNullNotPushedDown` in 
`PushDownCountThroughJoinTest.java` that constructs `Count(NullLiteral)` with 
GROUP BY and verifies `PushDownAggThroughJoin` does NOT rewrite it. Also added 
a COUNT_ON_INDEX regression test with inverted index + `explain shape plan` 
asserting count(null) plan does NOT contain `COUNT_ON_MATCH`.



-- 
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]

Reply via email to