Skip to content
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

Throw TrinoException in dropNamespace when REST error #22030

Merged

Conversation

pajaks
Copy link
Member

@pajaks pajaks commented May 20, 2024

Description

In case External REST catalog throws exception it should be wrapped into TrinoException and have more clear error type.

Additional context and related issues

Example stack:

 "type": "org.apache.iceberg.exceptions.ForbiddenException",
  "message": "Forbidden: Access Denied",
  "suppressed": [],
  "stack": [
    "org.apache.iceberg.rest.ErrorHandlers$DefaultErrorHandler.accept(ErrorHandlers.java:212)",
    "org.apache.iceberg.rest.ErrorHandlers$NamespaceErrorHandler.accept(ErrorHandlers.java:180)",
    "org.apache.iceberg.rest.ErrorHandlers$NamespaceErrorHandler.accept(ErrorHandlers.java:166)",
    "org.apache.iceberg.rest.HTTPClient.throwFailure(HTTPClient.java:201)",
    "org.apache.iceberg.rest.HTTPClient.execute(HTTPClient.java:313)",
    "org.apache.iceberg.rest.HTTPClient.execute(HTTPClient.java:252)",
    "org.apache.iceberg.rest.HTTPClient.delete(HTTPClient.java:389)",
    "org.apache.iceberg.rest.RESTClient.delete(RESTClient.java:52)",
    "org.apache.iceberg.rest.RESTSessionCatalog.dropNamespace(RESTSessionCatalog.java:530)",
    "io.trino.plugin.iceberg.catalog.rest.TrinoRestCatalog.dropNamespace(TrinoRestCatalog.java:147)",
    "io.trino.plugin.iceberg.IcebergMetadata.dropSchema(IcebergMetadata.java:901)",
    "io.trino.plugin.base.classloader.ClassLoaderSafeConnectorMetadata.dropSchema(ClassLoaderSafeConnectorMetadata.java:430)",
    "io.trino.tracing.TracingConnectorMetadata.dropSchema(TracingConnectorMetadata.java:358)",
    "io.trino.metadata.MetadataManager.dropSchema(MetadataManager.java:789)",
    "io.trino.tracing.TracingMetadata.dropSchema(TracingMetadata.java:382)",
    "io.trino.execution.DropSchemaTask.execute(DropSchemaTask.java:79)",
    "io.trino.execution.DropSchemaTask.execute(DropSchemaTask.java:37)",

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.
( ) Release notes are required. Please propose a release note for me.
( ) Release notes are required, with the following suggested text:

# Section
* Fix some things. ({issue}`issuenumber`)

@cla-bot cla-bot bot added the cla-signed label May 20, 2024
@pajaks pajaks requested review from wendigo, findepi and losipiuk May 20, 2024 11:53
@github-actions github-actions bot added the iceberg Iceberg connector label May 20, 2024
@losipiuk losipiuk merged commit 98a2da7 into trinodb:master May 20, 2024
43 checks passed
@losipiuk losipiuk added the no-release-notes This pull request does not require release notes entry label May 20, 2024
@github-actions github-actions bot added this to the 449 milestone May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed iceberg Iceberg connector no-release-notes This pull request does not require release notes entry
Development

Successfully merging this pull request may close these issues.

3 participants