Preserve table catalog/schema in ALTER TABLE qualified_name RENAME TO unqualified_name#11282
Conversation
a599643 to
933601c
Compare
|
The CI is red. |
ff4914f to
103c870
Compare
There was a problem hiding this comment.
Can we have a method in BCT to fill in required table properties (default: none), so that we don't need to override such nice and verbose test method?
There was a problem hiding this comment.
Thank you for seeing this cleaner way to customize the tests for delta lake.
By using a createSchema(String schemaName) method, we can spare the duplication of the test methods.
There was a problem hiding this comment.
add empty line after // TODO: better fix would, since the code line and comment are unrelated
There was a problem hiding this comment.
BTW skipTestUnless is not needed in a specific test class (here), because it knows what it does and doesn't support
There was a problem hiding this comment.
Not applying anymore because the duplicated test method has been removed from the class.
There was a problem hiding this comment.
in prep commit move testRenameTableAcrossSchema directly below testRenameTable
and then add this new test after the two
testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorTest.java
Outdated
Show resolved
Hide resolved
testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorTest.java
Outdated
Show resolved
Hide resolved
testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorTest.java
Outdated
Show resolved
Hide resolved
testing/trino-testing/src/main/java/io/trino/testing/BaseConnectorTest.java
Outdated
Show resolved
Hide resolved
103c870 to
b28412f
Compare
There was a problem hiding this comment.
actually, assertFalse(getQueryRunner().tableExists(getSession(), tableName)); would succeed even before rename. You don't pass sourceSchemaName here (and you cannot).
For simplicity, let's skip the assertion.
When dealing with unqualified object names for the target table, use the source table name for deducing the target qualified object name.
b28412f to
cbbd514
Compare
Description
When performing
ALTER TABLE xxx RENAME TO yyydeduce the qualified object name ofyyyfrom the session and use the source as a fallbackThis is a bugfix.
Fix.
See #11281
Related issues, pull requests, and links
Fixes #11281
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
(x) No release notes entries required.
( ) Release notes entries required with the following suggested text: