Skip to content

feat(plugins): add BucketResolverPlugin for multi-bucket dataset queries - #51

Merged
grommett merged 3 commits into
mainfrom
feat/dataset-bucket-plugin
Aug 1, 2026
Merged

grommett merged 3 commits into
mainfrom
feat/dataset-bucket-plugin

Conversation

@grommett

Copy link
Copy Markdown
Owner

Summary

  • Adds BucketResolverPlugin, a processQuery-hook plugin that fills in a missing bucket/endpoint per file by matching each parsed file path against configured dataset prefix entries. Resolution runs per file (not per query), so a single query can join across datasets that live in different buckets.
  • Files with no matching prefix are left untouched — no fallback to the first configured dataset — so the existing "no bucket configured" error still surfaces normally.
  • Exported from s3quoia.js alongside FSPurgePlugin/StatsPlugin/AvroPlugin. Opt-in via the plugins.
  • Documents the plugin in the README (s3quoia() usage and S3QuoiaMCP usage).

This potentially supersedes the approach discussed on #50, which did per query by substring-matching raw SQL.

Test plan

  • npm test — 154 unit tests pass, including new BucketResolverPlugin unit tests
  • npm run test:e2e — 20 e2e tests pass against real MinIO, including two new tests: single-dataset bucket resolution with no defaultBucket, and a join across two files in two different buckets resolved purely by BucketResolverPlugin with no bucket tokens in the SQL
  • npm run lint and prettier clean

grommett added 3 commits July 20, 2026 11:50
Resolves a missing bucket/endpoint per file by matching parsed file paths
against configured dataset prefixes. Runs after QueryParserPlugin so each
file in a query is resolved independently, letting a single query join
across datasets that live in different buckets. Opt-in via the plugins
array, consistent with FSPurgePlugin/StatsPlugin/AvroPlugin.
The "past day" cache fixture was hardcoded to day=01, colliding with
today's own day-level prefix whenever the suite runs on the 1st of the
month (UTC) and making the "past day entries should remain" assertion
fail. Derive it relative to the actual current day instead.
list_files talks to S3 directly and never runs through the query pipeline
that BucketResolverPlugin's processQuery hooks into, so it couldn't
auto-resolve a bucket from datasets. Add a resolveListFiles hook to the
plugin (sharing its prefix-matching logic with processQuery) and have
ListFilesTool reduce over config.plugins to call it — kept local to the
MCP tool rather than lifecycle.js, since that module is scoped to the
s3quoia() query/download pipeline which list_files never touches.

Adding BucketResolverPlugin to config.plugins now covers both the query
and list_files tools with no extra configuration.
@grommett
grommett merged commit 9cacd5e into main Aug 1, 2026
2 checks passed
@grommett
grommett deleted the feat/dataset-bucket-plugin branch August 1, 2026 01:49
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