Skip to content

feat: add dynamic filter store in coordinator - #592

Closed
jayshrivastava wants to merge 3 commits into
mainfrom
js/dynamic-filter-coordinator-registry
Closed

feat: add dynamic filter store in coordinator#592
jayshrivastava wants to merge 3 commits into
mainfrom
js/dynamic-filter-coordinator-registry

Conversation

@jayshrivastava

@jayshrivastava jayshrivastava commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

This PR adds a registry in the query coordinator for collecting dynamic filter expressions by expression ID. These can be collected during planning once apply_expressions becomes available.

This store counts received expressions (so we know when we've collected all the filters from workers in a task) and supports the merge() operation which ORs them, following the RFC.

Informs: #532

Remaining work

  • implmement dynamic filter update collection and propagation from worker <-> coordinator

Add a registry in the query coordinator for collecting dynamic filter expressions by
expression ID. These can be collected during planning once
`apply_expressions` becomes available.

This store counts received expressions (so we know when we've collected
all the filters from workers in a task) and supports the merge()
operation which ORs them, following the
[RFC](#553).

Remaining work
- implmement dynamic filter update collection and propagation from
  worker <-> coordinator
&self.metrics,
self.metrics_store.clone(),
// Dynamic-filter discovery will supply the query's expression IDs here.
std::iter::empty(),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Eventually, I will implement a plan traversal which collects dynamic filters using apply_expressions

@jayshrivastava jayshrivastava changed the title feat: add query-scoped dynamic filter store feat: add dynamic filter store in coordinator Aug 6, 2026
@jayshrivastava
jayshrivastava marked this pull request as ready for review August 6, 2026 21:38
Comment on lines +14 to +16
pub(super) struct DynamicFilterStore {
expressions: Mutex<HashMap<ExpressionId, Vec<Arc<dyn PhysicalExpr>>>>,
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It's probably too soon to start speculating about how this will look like.

For example, I'm certain that this is not going to be enough, and that we should be using a Tokio Watch for broadcasting updates.

I recommend to defer this work until we can actually verify that dynamic filters work end to end, otherwise we will be merging code that I'm pretty sure we'll need to heavily change in the future.

One thing we can start doing is building on top of a branch that cherry picks all necessary work upstream, and creating these new extra structs in this project for having dynamic filters working end to end.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

No problem! I'll close this out

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