You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The filesystem catalog could discover a database or table while listing an object-store prefix, then reject the same entry when checking the exact path. Existing Paimon warehouses often have objects below a prefix without a directory marker, so an exact HEAD request is not enough to determine whether a database exists.
Table existence also needs to be based on schema files rather than the table directory itself. This is the behavior used by the Java filesystem catalog.
Brief change log
Add a directory-aware existence check to FileIO.
Use directory semantics when checking filesystem catalog databases.
Check schema-0 first, then fall back to other schema IDs when checking tables.
Filter directories without a valid schema from list_tables().
Tested against a local MinIO container with an empty database, a markerless database and table, a table starting at schema-1, and an incomplete table directory.
API and Format
This adds FileIO::exists_dir(). There is no storage format change.
PR changes “table existence” to “schema must exist,” and list_tables() will also filter out orphaned directories without a schema; however, drop_database(cascade=false) still checks the original subdirectories directly. As a result, the Catalog shows that the database has no tables, but it returns DatabaseNotEmpty due to an incomplete or orphaned directory. The Java implementation uses listTables(name) for this check; the semantics should be standardized.
Good catch. I updated drop_database() to use list_tables(name) for the non-cascade emptiness check, matching the Java catalog semantics. I also added a regression test covering a database that contains only an incomplete table directory: it is not listed as a table and the database can be dropped without cascade.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Purpose
Linked issue: close #527
The filesystem catalog could discover a database or table while listing an object-store prefix, then reject the same entry when checking the exact path. Existing Paimon warehouses often have objects below a prefix without a directory marker, so an exact HEAD request is not enough to determine whether a database exists.
Table existence also needs to be based on schema files rather than the table directory itself. This is the behavior used by the Java filesystem catalog.
Brief change log
FileIO.schema-0first, then fall back to other schema IDs when checking tables.list_tables().Tests
cargo test -p paimon --all-targets --features fulltext,vortexcargo clippy --all-targets --workspace --features fulltext,vortex -- -D warningscargo fmt --all -- --checkcargo check -p paimon --features storage-s3schema-1, and an incomplete table directory.API and Format
This adds
FileIO::exists_dir(). There is no storage format change.Documentation
No documentation changes are needed.