Skip to content

fix: support UNCACHE TABLE IF EXISTS in Spark 3.3+#98

Open
yuanoOo wants to merge 2 commits intooceanbase:mainfrom
yuanoOo:fix-uncache
Open

fix: support UNCACHE TABLE IF EXISTS in Spark 3.3+#98
yuanoOo wants to merge 2 commits intooceanbase:mainfrom
yuanoOo:fix-uncache

Conversation

@yuanoOo
Copy link
Collaborator

@yuanoOo yuanoOo commented Feb 4, 2026

Summary

This PR adds support for the `UNCACHE TABLE IF EXISTS` syntax introduced in Spark 3.3+.

Changes

  • Added table existence check in `loadTable` method before attempting to load the table
  • Import `NoSuchTableException` to properly handle non-existent tables
  • This ensures that `UNCACHE TABLE IF EXISTS` works correctly with OceanBase catalog

Testing

The change ensures that when `UNCACHE TABLE IF EXISTS` is executed, the catalog properly checks if the table exists before attempting to load it, preventing unnecessary errors when the table does not exist.

Add table existence check in loadTable method to support UNCACHE TABLE IF EXISTS syntax introduced in Spark 3.3+
Implemented a new test case in OBCatalogMySQLITCase to verify the behavior of the UNCACHE TABLE IF EXISTS command. The test checks both scenarios: when the table exists and when it does not, ensuring that no exceptions are thrown in either case. This enhances the test coverage for Spark 3.3+ features.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant