Skip to content

fix: handle empty catalogs where data directory does not exist#70

Merged
zfarrell merged 3 commits intomainfrom
fix/empty-catalog
Feb 24, 2026
Merged

fix: handle empty catalogs where data directory does not exist#70
zfarrell merged 3 commits intomainfrom
fix/empty-catalog

Conversation

@zfarrell
Copy link
Contributor

Summary

  • Replace canonicalize() with std::path::absolute() in parse_local_path() so the data directory does not need to exist at catalog creation time
  • Supports new DuckLake catalogs with schema/table definitions but no data files yet (e.g., after CREATE TABLE but before INSERT)
  • Closes Empty catalog with no .files/ directory fails to open #57

Details

canonicalize() requires the path to exist on disk and resolves symlinks. For empty catalogs, the .files/ data directory hasn't been created yet, causing catalog initialization to fail. std::path::absolute() (stable since Rust 1.79) converts relative paths to absolute without requiring existence.

Test plan

  • Test nonexistent paths now succeed instead of erroring
  • Test nonexistent paths with trailing slash preserved
  • All 49 path_resolver tests pass
  • cargo build succeeds

🤖 Generated with Claude Code

zfarrell and others added 2 commits February 24, 2026 05:41
Replace canonicalize() with std::path::absolute() in parse_local_path()
so that the data directory is not required to exist at catalog creation
time. This supports new DuckLake catalogs that have schemas/tables
defined but no data files written yet.

Closes #57

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a standalone '..' path component check in parse_local_path() to
prevent directory traversal attacks. std::path::absolute() does not
normalize '..' components, so without this check a malicious data_path
like "/data/../../../etc/" would pass through unchanged.

Closes #57
@zfarrell zfarrell merged commit 424ac81 into main Feb 24, 2026
3 checks passed
@zfarrell zfarrell deleted the fix/empty-catalog branch February 24, 2026 19:40
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.

Empty catalog with no .files/ directory fails to open

1 participant