DataFusion-Federation: Union Flattening Across Executors #22168
Replies: 1 comment
|
Yes, the flattening is intentional in core DataFusion, but the loss of this particular pushdown opportunity is a federation-planner limitation rather than a reason that UNION flattening is generally wrong.
This behavior is currently pinned by Disabling So: pushing the same-executor union down is better when that executor supports it, but it should be implemented as federation-aware regrouping with capability/error handling, not by globally disabling the core union optimization. |
Uh oh!
There was an error while loading. Please reload this page.
I was experimenting with union pushdown behavior in DataFusion Federation and noticed something I wanted to clarify.
Setup:
t1,t2t3The initial logical plan looks like:
With
optimize_unionsenabled, this is flattened into:This results in three independent SELECTs being executed, with the UNION performed in-memory.
If I disable
optimize_unionsoptimizer rule, Executor 1 instead receives a single pushed-down SQL query:while Executor 2 executes its own SELECT, followed by one final in-memory UNION.
Is flattening unions across executor boundaries here an intentional optimizer choice? Would pushing down UNIONs be better?
All reactions