Skip to content

add more exception message when getIcebergView failed #25565

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

XavieLee
Copy link

Description

Add configuration iceberg.rest-catalog.view-endpoints-enabled value in exception message when get iceberg view failed.

Additional context and related issues

#25556

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

Copy link

cla-bot bot commented Apr 14, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@github-actions github-actions bot added the iceberg Iceberg connector label Apr 14, 2025
@XavieLee
Copy link
Author

Hi @ebyhr May I know how to test this change?

throw new TrinoException(ICEBERG_CATALOG_ERROR, "Failed to load view '%s'".formatted(viewName.getTableName()), e);
throw new TrinoException(ICEBERG_CATALOG_ERROR,
"Failed to load view '%s', the configuration 'iceberg.rest-catalog.view-endpoints-enabled' is '%s'".formatted(viewName.getTableName(),
restSessionCatalog.properties().getOrDefault("view-endpoints-supported", "false")), e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
restSessionCatalog.properties().getOrDefault("view-endpoints-supported", "false")), e);
restSessionCatalog.properties().getOrDefault("view-endpoints-supported", "false")),
e);

@@ -712,7 +712,9 @@ private Optional<View> getIcebergView(ConnectorSession session, SchemaTableName
return Optional.empty();
}
catch (RESTException e) {
throw new TrinoException(ICEBERG_CATALOG_ERROR, "Failed to load view '%s'".formatted(viewName.getTableName()), e);
throw new TrinoException(ICEBERG_CATALOG_ERROR,
"Failed to load view '%s', the configuration 'iceberg.rest-catalog.view-endpoints-enabled' is '%s'".formatted(viewName.getTableName(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change doesn't make sense to me. We should include the property name only when the error cause is related to the property.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iceberg Iceberg connector
Development

Successfully merging this pull request may close these issues.

3 participants