Skip to content

Add split ID inclusion filter - #6706

Open
Mallets wants to merge 6 commits into
mainfrom
mallets/metastore-list
Open

Add split ID inclusion filter#6706
Mallets wants to merge 6 commits into
mainfrom
mallets/metastore-list

Conversation

@Mallets

@Mallets Mallets commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR extends ListSplitsQuery with an optional inclusion filter that limits results to a caller-provided set of split IDs.

The filter is implemented consistently in both metastore backends:

  • File-backed listings reject splits that are outside the inclusion set.
  • PostgreSQL listings use a single typed array bind with = ANY(...), avoiding PostgreSQL's parameter limit for large sets.
  • The JSON field is optional when deserializing, preserving compatibility with requests sent by older callers during a rolling upgrade.

An empty inclusion set deliberately matches no splits; an absent filter leaves listings unchanged.

How was this PR tested?

  • cargo test -p quickwit-metastore --all-features included_split_ids --lib — validates the PostgreSQL SQL builder and backward-compatible query deserialization.
  • cargo test -p quickwit-metastore --all-features test_metastore_list_all_splits --lib — the file-backed metastore integration test passed; the PostgreSQL variant requires QW_TEST_DATABASE_URL, which is not configured locally.

Allow callers to restrict split listings to a specified set while keeping file-backed and PostgreSQL metastores aligned.
@Mallets
Mallets marked this pull request as ready for review August 18, 2026 16:27
@Mallets
Mallets requested a review from a team as a code owner August 18, 2026 16:27

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: de029043a3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread quickwit/quickwit-metastore/src/metastore/file_backed/file_backed_index/mod.rs Outdated
Ensure file-backed split listings honor inclusion filters when a maturity filter is also present.
return false;
}

if let Some(included_split_ids) = &query.included_split_ids

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The inclusion and exclusion logic should live next to each other.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in b99cb9d.

I moved both cheap included and excluded checks at the beginning since this comment applies to both.

Comment thread quickwit/quickwit-metastore/src/metastore/postgres/utils.rs
Comment thread quickwit/quickwit-metastore/src/metastore/mod.rs Outdated
Deduplicate PostgreSQL split-ID array binding and omit absent inclusion filters from serialized queries for rollback compatibility.
Reject included and excluded split IDs before evaluating more expensive file-backed query predicates.
Use distinct names for converted PostgreSQL array values in inclusion and exclusion filters.
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.

2 participants