fsk119 commented on code in PR #22768:
URL: https://github.com/apache/flink/pull/22768#discussion_r1250093654


##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationExecutor.java:
##########
@@ -324,15 +332,16 @@ public TableEnvironmentInternal getTableEnvironment() {
 
         final Executor executor =
                 lookupExecutor(streamExecEnv, 
sessionContext.getUserClassloader());
+        ResourceManager resourceManager = 
sessionContext.getSessionState().resourceManager.copy();

Review Comment:
   Currently the ResourceManager uses lazy loading strategy to load the used 
resources. That is, the resource manager will add the function jar 
resources(*the function is not temporary*) when the query uses this. If we use 
a seperate resource manager here, it has some side efforts:
   
   1. we will keep downloading from the remote function jar when using it
   2. it's hard to track whether the resource manager contains the resource 
with the same resource uri.



##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationExecutor.java:
##########
@@ -440,11 +449,41 @@ private ResultFetcher executeOperation(
             return callShowJobsOperation(tableEnv, handle, (ShowJobsOperation) 
op);
         } else if (op instanceof RemoveJarOperation) {
             return callRemoveJar(handle, ((RemoveJarOperation) op).getPath());
+        } else if (op instanceof AddJarOperation
+                || op instanceof ShowJarsOperation
+                || op instanceof CreateTempSystemFunctionOperation
+                || op instanceof CreateCatalogFunctionOperation
+                || op instanceof ShowFunctionsOperation) {
+            return callExecutableOperation(handle, (ExecutableOperation) op);
         } else {
             return callOperation(tableEnv, handle, op);
         }
     }
 
+    private ResultFetcher callExecutableOperation(OperationHandle handle, 
ExecutableOperation op) {
+        TableResultInternal result =
+                op.execute(
+                        new ExecutableOperationContextImpl(
+                                
sessionContext.getSessionState().catalogManager,
+                                
sessionContext.getSessionState().functionCatalog,
+                                sessionContext.getSessionState().moduleManager,
+                                
sessionContext.getSessionState().resourceManager,
+                                tableConfig()));
+        return ResultFetcher.fromTableResult(handle, result, false);
+    }
+
+    private TableConfig tableConfig() {
+        // checks the value of RUNTIME_MODE

Review Comment:
   The comment doesn't match the codes below.



##########
flink-table/flink-sql-client/src/test/resources/sql/function.q:
##########
@@ -230,6 +230,11 @@ create function upperudf AS 'UpperUDF' using jar 
'$VAR_UDF_JAR_PATH';
 [INFO] Execute statement succeed.
 !info
 
+# `SOW JARS` does not list the jars being used by function, it only list all 
the jars added by `ADD JAR`

Review Comment:
   SOW -> SHOW
   
   The comment is not correct here. If we create `TEMPORARY` funcion, we will 
find the SHOW JAR list the udf jar here.



-- 
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: issues-unsubscr...@flink.apache.org

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

Reply via email to