Provide safe default implementation of getTableHandle #27047
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Provide safe default implementation of
ConnectorMetadata.getTableHandle. This prevents exception when tryingto access a table from a connector that exposes no regular tables at
all, such as
GlobalSystemConnectorthat powers the builtinsystemcatalog.
This change impacts regular queries for non-existent tables in existing
schemas of the system catalog, such as:
After the change, a correct "Table does not exist" error is returned.
This change also affects metadata listing operations, such as
or
Metadata listing operations are highly optimized and call
getTableHandledirectly if it is possible to avoid listing tables.Before the change the query would succeed, but would result in a
ConnectorMetadata getTableHandle() is not implementedexception loggedat WARN level. After the change, no exception is logged.
ConnectorMetadata getTableHandle() is not implementedexception logged when handling legitimate user query #27045Release notes
Summary by Sourcery
Provide a safe default implementation of ConnectorMetadata.getTableHandle, fix error handling for non-existent tables in system catalogs, and add tests to verify the correct "Table does not exist" behavior.
Bug Fixes:
Enhancements:
Tests: