Skip to content

Conversation

@singhpk234
Copy link

What changes were proposed in this pull request?

This change attempts to make V2SessionCatalog return NoSuchNameSpaceException rather than NoSuchDataseException

Why are the changes needed?

if a catalog doesn't overrides namespaceExists it by default uses loadNamespaceMetadata and in case a db not exists loadNamespaceMetadata throws a NoSuchDatabaseException which is not catched and we see failures even with if exists clause. One such use case we observed was in iceberg table a post test clean up was failing with NoSuchDatabaseException now. Also queries such as DROP TABLE IF EXISTS {} fails with no such db exception.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Modified the UT to match the proposed behviour

@github-actions github-actions bot added the SQL label Jun 21, 2022
@singhpk234
Copy link
Author

cc @cloud-fan @huaxingao

@singhpk234 singhpk234 force-pushed the fix/loadNamespaceMetadata branch from 99c255d to fb95f9c Compare June 21, 2022 19:02
@AmplabJenkins
Copy link

Can one of the admins verify this patch?

Copy link
Contributor

@cloud-fan cloud-fan left a comment

Choose a reason for hiding this comment

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

good catch!

@cloud-fan cloud-fan closed this in 9513393 Jun 23, 2022
cloud-fan pushed a commit that referenced this pull request Jun 23, 2022
…ception in loadNamspaceMetadata

### What changes were proposed in this pull request?

This change attempts to make V2SessionCatalog return NoSuchNameSpaceException rather than NoSuchDataseException

### Why are the changes needed?

if a catalog doesn't overrides `namespaceExists` it by default uses `loadNamespaceMetadata` and in case a `db` not exists loadNamespaceMetadata throws a `NoSuchDatabaseException` which is not catched and we see failures even with `if exists` clause. One such use case we observed was in iceberg table a post test clean up was failing with `NoSuchDatabaseException` now. Also queries such as `DROP TABLE IF EXISTS {}` fails with no such db exception.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

Modified the UT to match the proposed behviour

Closes #36948 from singhpk234/fix/loadNamespaceMetadata.

Authored-by: Prashant Singh <psinghvk@amazon.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
(cherry picked from commit 9513393)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
@cloud-fan
Copy link
Contributor

thanks, merging to master/3.3

@singhpk234 singhpk234 deleted the fix/loadNamespaceMetadata branch June 23, 2022 16:35
@singhpk234
Copy link
Author

Thanks for the review @cloud-fan , @huaxingao !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants