https://github.com/apache/spark
Revision 86e3514ceeac0b494ec58cbd413ae957f4d4bc8d authored by Prashant Singh on 23 June 2022, 05:25:08 UTC, committed by Wenchen Fan on 23 June 2022, 05:25:26 UTC
### 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 95133932a661742bf0dd1343bc7eda08f2cf752f)
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
1 parent be9fae2
History
Tip revision: 86e3514ceeac0b494ec58cbd413ae957f4d4bc8d authored by Prashant Singh on 23 June 2022, 05:25:08 UTC
[SPARK-39547][SQL] V2SessionCatalog should not throw NoSuchDatabaseException in loadNamspaceMetadata
Tip revision: 86e3514

README.md

back to top