You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "rosakng (via GitHub)" <gi...@apache.org> on 2025/11/05 22:34:15 UTC
Re: [PR] [FLINK-38516][Table SQL/Gateway] Add config for read-only sql gateway [flink]
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org