[FLINK-38516][Table SQL/Gateway] Add config for read-only sql gateway #27118
+57
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/FLINK-38516
What is the purpose of the change
The Flink SQL Gateway currently lacks native support for read-only mode to restrict ModifyOperations (e.g., INSERT, DELETE). This feature allows ad-hoc querying on shared session clusters without risk of data modification.
This pull request adds a a configuration parameter
sql-gateway.read-onlysuch that if enabled, it rejects SQL statements attempting to modify data or schema.Brief change log
Creates read-only sql gateway configuration that blocks execution of modification queries if enabled.
Verifying this change
Submit a FlinkSQL modification query to a session cluster and check that executing the query throws an exception i.e.

sql-gateway.read-only: true) and if the query is a modifying operation.Full stack trace:
Click to expand
Does this pull request potentially affect one of the following parts:
@Public(Evolving): noDocumentation