Skip to content

Read hf:// URLs from DuckDB by mounting stores where the registry says - #9265

Merged
robert3005 merged 2 commits into
developfrom
claude/vortex-hugging-face-format-1asxf3
Aug 7, 2026
Merged

Read hf:// URLs from DuckDB by mounting stores where the registry says#9265
robert3005 merged 2 commits into
developfrom
claude/vortex-hugging-face-format-1asxf3

Conversation

@robert3005

@robert3005 robert3005 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Duckdb filesystem resolution uses default registry behaviour

…try says

DuckDB resolved scan URLs by clearing the URL path and mounting the store at
the authority, then globbing the full URL path against it. That assumption held
for every scheme so far, but not for `hf://`: a Hugging Face store is rooted at
a repository and revision, which occupy path segments, so the authority-rooted
URL (`hf://datasets`) does not even name a repository and the full path would
address the wrong keys.

Resolve the full URL instead and glob the path the registry reports — for
authority-mounted schemes that is the whole URL path, so their behavior is
unchanged, and only the registry knows how deep any other scheme mounts. The
per-bind filesystem cache goes away because the registry already caches one
client per store prefix; the filesystem wrapper rebuilt per glob is a thin
adapter. This also percent-decodes the globbed path, which the raw URL path
was not.

The Hub serves no listing, so wildcard globs over `hf://` fail with the store's
listing error; exact file paths work because a glob-free pattern is resolved
with `head` alone.

The Java binding still cannot read `hf://`: it keys reads by the full URL path
against a store built by its own scheme dispatch, so it needs the same move to
registry-reported mounting. Left for a follow-up.

Towards #5379.

Signed-off-by: Robert Kruszewski <robert@spiraldb.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lc5zw7Le2T3pakDEUdKTYd

@myrrc myrrc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM but sometimes in the future we should use duckdb's IO so that vortex library wouldn't bundle all these libraries

@robert3005 robert3005 added the changelog/feature A new feature label Aug 7, 2026
@robert3005

Copy link
Copy Markdown
Contributor Author

yes, this is really just unifying the logic everywhere

…al module

`crate::opendal` only exists under a service feature (cos/oss/goosefs), so the
intra-doc link in the hf module header dangles in an hf-only build. The
`supports_scheme` doc had the same problem and was un-linked in review; this is
the one that was missed. Verified with `cargo doc` under `hf,registry` alone
and under `--all-features`.

Signed-off-by: Robert Kruszewski <robert@spiraldb.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Lc5zw7Le2T3pakDEUdKTYd
@robert3005
robert3005 marked this pull request as ready for review August 7, 2026 11:20
@robert3005
robert3005 requested a review from AdamGS August 7, 2026 11:20
@robert3005
robert3005 enabled auto-merge (squash) August 7, 2026 12:46
@robert3005
robert3005 merged commit be332fc into develop Aug 7, 2026
85 of 86 checks passed
@robert3005
robert3005 deleted the claude/vortex-hugging-face-format-1asxf3 branch August 7, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/feature A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants