yuzelin commented on code in PR #21133:
URL: https://github.com/apache/flink/pull/21133#discussion_r1022277824
##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationExecutor.java:
##########
@@ -84,6 +90,30 @@ public OperationExecutor(SessionContext context,
Configuration executionConfig)
this.executionConfig = executionConfig;
}
+ public ResultFetcher configureSession(OperationHandle handle, String
statement) {
+ TableEnvironmentInternal tableEnv = getTableEnvironment();
+ List<Operation> parsedOperations =
tableEnv.getParser().parse(statement);
+ if (parsedOperations.size() > 1) {
+ throw new UnsupportedOperationException(
+ "Unsupported SQL statement! Execute statement only accepts
a single SQL statement or "
+ + "multiple 'INSERT INTO' statements wrapped in a
'STATEMENT SET' block.");
+ }
+ Operation op = parsedOperations.get(0);
+ if (!(op instanceof SetOperation)
+ && !(op instanceof ResetOperation)
+ && !(op instanceof CreateOperation)
+ && !(op instanceof DropOperation)
+ && !(op instanceof UseOperation)
+ && !(op instanceof AlterOperation)
+ && !(op instanceof LoadModuleOperation)
+ && !(op instanceof UnloadModuleOperation)
+ && !(op instanceof AddJarOperation)) {
Review Comment:
I think we should not support RemoveJar in gateway side. Let me explain.
The `configureSession` is mostly for the client to execute initialization
file, and RemoveJar is one of the legal operations in initialization file.
Currently, the implementation of RemoveJarOperation depends on
`ClientWrapperClassLoader`. As it's comment said, I think the implementation
has some technical problems, so
maybe it's better to let the RemoveJar implementation be in the client side
now. The `Executor#removeJar` can do the work.
--
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]