-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add redirection awareness for ADD COLUMN, COMMENT, DROP table tasks #11072
Add redirection awareness for ADD COLUMN, COMMENT, DROP table tasks #11072
Conversation
324e709
to
1bef4af
Compare
core/trino-main/src/main/java/io/trino/execution/DropTableTask.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/CommentTask.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/AddColumnTask.java
Outdated
Show resolved
Hide resolved
core/trino-main/src/main/java/io/trino/execution/AddColumnTask.java
Outdated
Show resolved
Hide resolved
28adcd6
to
39f330a
Compare
QualifiedObjectName originalTableName = createQualifiedObjectName(session, statement, statement.getName()); | ||
RedirectionAwareTableHandle redirectionAwareTableHandle = metadata.getRedirectionAwareTableHandle(session, originalTableName); | ||
if (redirectionAwareTableHandle.getTableHandle().isEmpty()) { | ||
throw semanticException(TABLE_NOT_FOUND, statement, "Table does not exist: %s", originalTableName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to wrap the throw with a statement existence check?
if (!statement.isTableExists()) {
throw semanticException...
}
return immediateVoidFuture();
QualifiedObjectName originalTableName = createQualifiedObjectName(session, statement, prefix.get()); | ||
RedirectionAwareTableHandle redirectionAwareTableHandle = metadata.getRedirectionAwareTableHandle(session, originalTableName); | ||
if (redirectionAwareTableHandle.getTableHandle().isEmpty()) { | ||
throw semanticException(TABLE_NOT_FOUND, statement, "Table does not exist: " + originalTableName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminder for statement existence check.
39f330a
to
f62c8ec
Compare
Rebasing on |
f62c8ec
to
5347c09
Compare
@phd3 do you want to take another look? |
core/trino-main/src/main/java/io/trino/execution/DropTableTask.java
Outdated
Show resolved
Hide resolved
5347c09
to
86ad52a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM % pending CI
unrelated #11245 |
Description
Add redirection awareness for the following tasks:
This is a fix.
This is a core engine change affecting mainly hive/iceberg connectors.
In the context of dealing with a shared Hive Metastore Service where tables of different types can co-exist in the metastore, it is helpful for the end-user to perform automatically table redirections when the user is in the context of a hive schema, but is referencing an iceberg table.
Related issues, pull requests, and links
This is a spin-off from the PR: #10577
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:
Relates to #11202