morrySnow commented on code in PR #48843:
URL: https://github.com/apache/doris/pull/48843#discussion_r1986571452


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/FunctionRegistry.java:
##########
@@ -213,7 +214,9 @@ public List<FunctionBuilder> findUdfBuilder(String dbName, 
String name) {
                 List<FunctionBuilder> candidate = 
name2UdfBuilders.getOrDefault(scope, ImmutableMap.of())
                         .get(name.toLowerCase());
                 if (candidate != null && !candidate.isEmpty()) {
-                    FunctionUtil.checkEnableJavaUdfForNereids();
+                    if (candidate.stream().anyMatch(builder -> !(builder 
instanceof AliasUdfBuilder))) {
+                        FunctionUtil.checkEnableJavaUdfForNereids();
+                    }

Review Comment:
   we should move this check to 
`org.apache.doris.catalog.FunctionRegistry#findFunctionBuilder(java.lang.String,
 java.lang.String, java.util.List<?>)`
   
   do as below:
   we do two round search in candidates list if java udf is disable.
   first round we only search other udf.
   if no other udf is matched, we do second round search in java udf.
   if no java udf is matched yet, we report no function matched.
   if some java udfs are matched, we report java udf is disable.



-- 
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: commits-unsubscr...@doris.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to