HappenLee commented on code in PR #66942:
URL: https://github.com/apache/doris/pull/66942#discussion_r3859608572


##########
fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/AggCombinerFunctionBuilder.java:
##########
@@ -159,7 +181,8 @@ public String parameterDisplayString() {
 
     public static boolean isAggStateCombinator(String name) {
         return name.toLowerCase().endsWith(STATE_SUFFIX) || 
name.toLowerCase().endsWith(MERGE_SUFFIX)
-                || name.toLowerCase().endsWith(UNION_SUFFIX) || 
name.toLowerCase().endsWith(FOREACH_SUFFIX);
+                || name.toLowerCase().endsWith(UNION_SUFFIX) || 
name.toLowerCase().endsWith(COMBINE_SUFFIX)

Review Comment:
   Fixed in 4c317b6d04f. We now treat dynamically synthesized AggState 
combinator names as a reserved built-in namespace instead of preserving 
same-named UDF fallback.
   
   `<aggregate>_state`, `<aggregate>_merge`, `<aggregate>_union`, 
`<aggregate>_combine`, and `<aggregate>_foreach` cannot be created as new 
UDF/UDAF/UDTF/alias functions when the nested name is a built-in aggregate. 
Unqualified resolution and aggregate pre-binding therefore consistently select 
the built-in combinator, so `avg_combine(arg)` binds `arg` in aggregate-input 
scope. Existing same-named UDFs are outside the compatibility scope here and 
remain addressable only with an explicit database qualifier.
   
   The previous UDF compatibility branch and its collision tests have been 
removed. Added coverage verifies the raw input `ExprId` in both HAVING and 
ORDER BY and rejects reserved function names while still allowing a 
non-reserved name such as `abs_combine`.
   
   Validated with `CombineCombinatorTest` (10/10), `FillUpMissingSlotsTest` 
(12/12), and `CreateFunctionTest` (11/11); FE compilation and checkstyle also 
passed.
   



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