-
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
Suppress permission denied when listing materialized views in Iceberg Glue #15893
Conversation
suite-delta-lake-databricks104 & 113 hit #13199 |
stats.getGetTables()) | ||
.map(GetTablesResult::getTableList) | ||
.flatMap(List::stream) | ||
.filter(table -> isTrinoMaterializedView(table.getTableType(), firstNonNull(table.getParameters(), ImmutableMap.of()))) |
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.
nit: this will conflict with #15909
@@ -771,32 +770,32 @@ private void updateView(ConnectorSession session, SchemaTableName viewName, Conn | |||
@Override | |||
public List<SchemaTableName> listMaterializedViews(ConnectorSession session, Optional<String> namespace) | |||
{ | |||
ImmutableList.Builder<SchemaTableName> materializedViews = ImmutableList.builder(); |
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.
Use normal for loop in TrinoGlueCatalog.listMaterializedViews
seems like switching to a for loop isn't really necessary
why not add additional catch condition to the try catch
within flatMap
?
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.
I feel a for loop is cleaner than an additional try catch
within flatMap
.
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.
but there already was a catch. you need both in-loop and out-of-loop try-catches anyway, right?
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.
I thought you pointed another flatMap(List::stream)
. The AccessDeniedException
exception happened in the subsequent collect()
method when I confirmed previously.
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.
code is worth thousand words... i pushed a commit showing what i have in mind.
please let me know wdyt
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.
I reconfirmed the failed place was computeNext()
method in AwsSdkUtil#getPaginatedResults
. It causes the failure outside of the current catch block.
catch (EntityNotFoundException | AccessDeniedException e) {
// Namespace may have been deleted or permission denied
return Stream.empty();
}
})
.collect(toImmutableList()); // AccessDeniedException happened here
Sorry, I should have written more detailed information in the commit message.
Otherwise, upcoming AccessDeniedException would be caught by outer catch block.
5421fee
to
c1a4aab
Compare
Rebased on upstream to resolve conflicts. |
e7f1b7a
to
c1a4aab
Compare
CI hit #14441 |
Description
Suppress permission denied when listing materialized views in Iceberg Glue
Similar fixes as #14971
Release notes
(x) Release notes are required, with the following suggested text: