Add redirection awareness for RENAME table operation#11277
Add redirection awareness for RENAME table operation#11277findepi merged 2 commits intotrinodb:masterfrom
Conversation
There was a problem hiding this comment.
This was a mistake. Thank you for raising this point.
There was a problem hiding this comment.
do we have test coverage for this?
There was a problem hiding this comment.
We have a few tests:
- io.trino.security.TestAccessControl#testNonQueryAccessControl -> is using a rather naive io.trino.testing.TestingAccessControlManager behind the scenes (and no
systemAccessControls) - io.trino.testing.BaseConnectorTest#testRenameTable
However I haven't found a test interacting with a fine grained system access control implementation like https://trino.io/docs/current/security/file-system-access-control.html
There was a problem hiding this comment.
Did any test fail when you had target here?
There was a problem hiding this comment.
No. There were no failures as far as I can recall.
https://github.com/trinodb/trino/actions/runs/1922889046
There was a problem hiding this comment.
Can you please add a test? Orthogonal to this PR
There was a problem hiding this comment.
actually…. there should be two tests: we should have an access control test for rename; and we should have an access control test for rename with redirects; we should verify which table AC is asked about
There was a problem hiding this comment.
Created #11488 as a scaffolding for dealing with access control tests for redirections. I'll be adding support for RENAME TABLE there once it reaches master.
core/trino-main/src/main/java/io/trino/execution/RenameTableTask.java
Outdated
Show resolved
Hide resolved
...no-product-tests/src/main/java/io/trino/tests/product/hive/TestHiveRedirectionToIceberg.java
Outdated
Show resolved
Hide resolved
091a4a2 to
1b9e215
Compare
1b9e215 to
77e4d1c
Compare
77e4d1c to
049e645
Compare
049e645 to
29375ae
Compare
Description
Add redirection awareness for the
ALTER TABLE xxx RENAME TO yyystatement.The implementation follows the specification from #11202 (comment)
This implementation affects the core query engine.
In the context of working in an environment where Hive/Iceberg/Delta tables are mixed, allow the user to do a table rename by deriving the destination catalog and schema from the source table name.
When having the table redirection enabled in the
hiveconnector (viahive.iceberg-catalog-name=iceberginhive.properties) and a tableiceberg.default.iceberg_table_namewithin theicebergconnector, any of the following statements is considered valid:Related issues, pull requests, and links
Documentation
(x) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.
Release notes
( ) No release notes entries required.
(x) Release notes entries required with the following suggested text: