rosakng commented on code in PR #27118:
URL: https://github.com/apache/flink/pull/27118#discussion_r2496410719
##########
flink-table/flink-sql-gateway/src/main/java/org/apache/flink/table/gateway/service/operation/OperationExecutor.java:
##########
@@ -681,6 +682,17 @@ private ResultFetcher callModifyOperations(
TableEnvironmentInternal tableEnv,
OperationHandle handle,
List<ModifyOperation> modifyOperations) {
+ // Check if SQL Gateway is in read-only mode
+ Configuration configuration = sessionContext.getSessionConf().clone();
+ configuration.addAll(executionConfig);
+ boolean isReadOnlyMode =
+
configuration.get(SqlGatewayServiceConfigOptions.SQL_GATEWAY_READ_ONLY_MODE);
+
+ if (isReadOnlyMode) {
+ throw new SqlExecutionException(
+ "SQL Gateway is in read-only mode. Modify operations are
not allowed.");
Review Comment:
@liuml07 I can instead pass in the sql statement to `callModifyOperations`
and log it there. Let me know what you think!
--
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]