Gate RTAS with 'replace.enabled' table property#640
Merged
Conversation
Closed
7 tasks
mkuchenbecker
previously approved these changes
Jun 25, 2026
mkuchenbecker
left a comment
Collaborator
There was a problem hiding this comment.
If you try to enable this table property we need a follow up to check if WAP or replication are enabled.
Collaborator
|
please look at the suggestion |
…erty Add a per-table flag that gates the RTAS (Replace Table As Select) command. RTAS is now blocked by default and is only allowed when the table has the regular table property 'replace.enabled' set to true. The gate is enforced in TablesServiceImpl (stageReplace) and IcebergSnapshotsServiceImpl (replaceCommit) via AuthorizationUtils.checkReplaceTableEnabled, which reads the table's persisted properties (so it cannot be bypassed by the incoming request body) and returns HTTP 400 when RTAS is disabled. Updated existing replace tests to opt in, added a negative test, and opted in the Spark/app RTAS integration tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> test(spark): add negative RTAS itest for disabled-by-default gate Add RTASTest.testRTASFailsWhenReplaceDisabled which creates a table without opting into RTAS and asserts that REPLACE TABLE ... AS SELECT is rejected with a BadRequestException carrying the "Replace (RTAS) is not enabled" message. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> fix fix fix add wap and replication style style style
4b8f685 to
27c5deb
Compare
Collaborator
|
Tests are failing |
added 2 commits
June 26, 2026 23:51
mkuchenbecker
approved these changes
Jun 29, 2026
Collaborator
|
This may break integration tests for Trino if they're already automated; please work with them to update before this rolls out. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Add a per-table flag that gates the RTAS command. RTAS is now blocked by default and is only permitted when the table has the regular table property
replace.enabledset totrue. The purpose is to disallow it in prod but allow it in testing until the feature is fully-fledged. The gate is set up in repo layer to check the table property when it sees thestagedReplaceorreplaceCommitflag. We also disallow RTAS when WAP or replication is enabled.Changes
Testing Done
Additional Information