liuml07 commented on code in PR #27118:
URL: https://github.com/apache/flink/pull/27118#discussion_r2441565819
##########
docs/content/docs/dev/table/sql-gateway/overview.md:
##########
@@ -250,6 +250,12 @@ $ ./sql-gateway -Dkey=value
<td>Duration</td>
<td>Keepalive time for an idle worker thread. When the number of
workers exceeds min workers, excessive threads are killed after this time
interval.</td>
</tr>
+ <tr>
+ <td><h5>sql-gateway.read-only</h5></td>
+ <td style="word-wrap: break-word;">5 min</td>
+ <td>Duration</td>
Review Comment:
```suggestion
<td>Boolean</td>
```
##########
docs/content/docs/dev/table/sql-gateway/overview.md:
##########
@@ -250,6 +250,12 @@ $ ./sql-gateway -Dkey=value
<td>Duration</td>
<td>Keepalive time for an idle worker thread. When the number of
workers exceeds min workers, excessive threads are killed after this time
interval.</td>
</tr>
+ <tr>
+ <td><h5>sql-gateway.read-only</h5></td>
+ <td style="word-wrap: break-word;">5 min</td>
Review Comment:
You meant `false` as default value?
##########
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:
I feel it's useful to show the `modifyOperations` in the error message in
case it's unclear to users which are actually violating the read-only mode.
--
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]