github-actions[bot] commented on code in PR #64783:
URL: https://github.com/apache/doris/pull/64783#discussion_r3465977973


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/DistinctWindowExpression.java:
##########
@@ -86,6 +87,9 @@ private Plan rewrite(LogicalWindow<Plan> window) {
     private Optional<AggregateFunction> 
convertToMultiDistinctFunction(AggregateFunction func) {
         if (func.isDistinct()) {
             if (func instanceof Count) {

Review Comment:
   This still misses `COUNT(DISTINCT *) OVER (...)`. The grammar accepts 
`DISTINCT` before a `funcExpression`, and `*` is a `primaryExpression`, but 
`LogicalPlanBuilder.processUnboundFunction` special-cases any `COUNT` with an 
`UnboundStar` into `new Count()` before preserving or validating the distinct 
flag. A reduced plan for `select count(distinct *) over() from multi` is 
therefore:
   
   ```text
   LogicalProject(count)
     LogicalWindow(Alias(WindowExpression(Count(*) distinct=false)))
       Scan(multi)
   ```
   
   Because this rule sees `COUNT(*)` with `distinct=false`, the new arity check 
is bypassed and the invalid zero-argument distinct window count is planned as a 
normal count-star window. Please reject `COUNT(DISTINCT *)` before the 
`COUNT(*)` special case, or preserve the distinct metadata long enough for this 
analytic-count validation to throw, and add a negative regression for it.



##########
regression-test/suites/query_p0/multi_distinct/multi_distinct_window.groovy:
##########
@@ -42,4 +42,9 @@ suite('multi_distinct_window') {
 
     qt_distinct_group_concat "select id, v1, group_concat(distinct v2) over() 
from multi order by id;"
 
+    test {

Review Comment:
   These newly added lines contain CR/trailing whitespace, and `git diff 
--check 
0f7917f100735cd507045d0313efbf23b88a019d..ad6959ee8ee5f3d0e8816eb76394b356b7282066`
 fails on lines 45-49. Please normalize this added block so the PR passes the 
repository whitespace check.



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