-
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
Handle BigQuery error when listing tables #20832
Handle BigQuery error when listing tables #20832
Conversation
catch (BigQueryException e) { | ||
throw new TrinoException(BIGQUERY_LISTING_TABLE_ERROR, "Failed to retrieve tables from BigQuery", e); | ||
} |
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 think this change breaks the exception handling in BigQueryMetadata#listTablesInRemoteSchema
method.
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.
Thanks! I changed listTablesInRemoteSchema
to catch TrinoException
instead assuming the client.listTableIds()
call in there is the only thing that could throw BigQueryException
.
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.
there's also toRemoteTable
which can call listTableIds
depending on what signature of toRemoteTable
is called. But it does wrap BigQueryException into a TrinoException.
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.
The toRemoteTable
version called by listTablesInRemoteSchema
doesn't call listTabeIds
, since it just called it directly and passed the IDs as tableIds
. So I think we're covered.
772b280
to
5615e39
Compare
plugin/trino-bigquery/src/main/java/io/trino/plugin/bigquery/BigQueryMetadata.java
Outdated
Show resolved
Hide resolved
5615e39
to
beba4da
Compare
Description
BigQuery
listTables
could throw anBigQueryException
and cause a TrinoINTERNAL_ERROR
. This PR catches & wraps it in a more specificEXTERNAL
error similar tolistDatasetIds
.