rfc: distributed dynamic filtering#553
Conversation
gabotechs
left a comment
There was a problem hiding this comment.
This is looking very good! I really do not have any major comments, this seems to be going in the right direction.
| The proposed change is to implement dynamic filtering similarly to Trino. | ||
|
|
||
| 1. During execution, the dynamic filter producers (`HashJoinExec`, `SortExec`, `AggregateExec`) will send dynamic filter updates to the coordinator. | ||
| 2. The coordinator will union / merge the dynamic filter updates from all workers. | ||
| 3. The coordinator will send the unioned / merged dynamic filter updates to the consumers (`DataSourceExec`). |
There was a problem hiding this comment.
👍 Sounds good, with the current infrastructure, I don't think it would be terrible difficult to do this
| - Less overhead than ORing | ||
|
|
||
| Cons: | ||
| - Is brittle. What if we have to support non-range and non-IN-LIST expressions? It would be nice if dynamic filters in vanilla datafusion natively implemented a `merge` or `union` operation |
There was a problem hiding this comment.
Why do you think it's brittle? For merging, I imagine you can just rely on Arrow comparison kernels for deduping IN LIST expressions.
|
|
||
| // Read Updates | ||
| pub fn current(&self) -> Result<Arc<dyn PhysicalExpr>> | ||
| pub(crate) fn subscribe(&self) -> DynamicFilterSubscription |
There was a problem hiding this comment.
🤔 subscribe not being public might be a problem.
|
|
||
| #### Options 1 & 2: Support new APIs In Vanilla DataFusion | ||
|
|
||
| See https://github.com/apache/datafusion/issues/23814 |
There was a problem hiding this comment.
apache/datafusion#23814 seems to be evolving in a good direction, and people seem engaged in the discussion, so I'd lean towards using whatever comes out of that.
Rendered View: https://github.com/datafusion-contrib/datafusion-distributed/blob/js/dynamic-filtering-design/rfcs/1-distributed-dynamic-filtering.md
Informs #528