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


##########
fe/fe-core/src/main/java/org/apache/doris/catalog/Database.java:
##########
@@ -748,14 +748,16 @@ public synchronized void replayAddFunction(Function 
function) {
 
     public synchronized void dropFunction(FunctionSearchDesc function, boolean 
ifExists) throws UserException {
         Function udfFunction = null;
-        if (ifExists) {
-            try {
-                // here we must first getFunction, as dropFunctionImpl will 
remove it
-                udfFunction = getFunction(function);
-            } catch (AnalysisException e) {
-                // ignore it, as drop it if exist, so can't sure it must exist
+        try {
+            // here we must first getFunction, as dropFunctionImpl will remove 
it
+            udfFunction = getFunction(function);
+        } catch (AnalysisException e) {
+            if (!ifExists) {
+                throw new UserException(e);
             }

Review Comment:
   !ifExists just return



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