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


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/PercentileArray.java:
##########
@@ -88,6 +90,28 @@ public void checkLegalityBeforeTypeCoercion() {
         }
     }
 
+    @Override

Review Comment:
   This post-rewrite validation also needs to run when the aggregate is exposed 
through a `_state` combinator. `CheckLegalityAfterRewrite` only visits 
expression-tree nodes; for `percentile_array_state(...)` the node is 
`StateCombinator`, whose children are the arguments and whose nested aggregate 
is just a field. `StateCombinator` currently delegates only 
`checkLegalityBeforeTypeCoercion()` to the nested aggregate, so the new checks 
here and in 
`Percentile`/`PercentileApprox`/`PercentileApproxWeighted`/`PercentileReservoir`
 are skipped for calls like `percentile_array_state(k, [null])` or 
`percentile_state(k, 1.2)`. Those eventually fail in BE const-argument setup, 
but direct aggregate calls now fail during Nereids legality checking. Please 
delegate post-rewrite legality through the `_state` wrapper as well, and add a 
negative `_state` case so this path stays covered.



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