2010YOUY01 commented on PR #27771:
URL: https://github.com/apache/datafusion/pull/27771#issuecomment-7269076727
How about we skip `JoinSelection` if it's run after `EnsureRequirements`,
like
```rust
impl PhysicalOptimizerRule for JoinSelection {
fn optimize_with_context(
&self,
plan: Arc<dyn ExecutionPlan>,
context: &dyn PhysicalOptimizerContext,
) -> Result<Arc<dyn ExecutionPlan>> {
// Skip join selection after EnsureRequirements has run.
if context.requirements_enforced() {
return Ok(plan);
}
// ...existing optimization logic...
}
}
```
The benefit of the auto-repair mechanism in this PR is that it enables
reoptimization in pipelines like `JoinSelection -> EnsureRequirements -> ... ->
JoinSelection`, at the cost of increased implementation complexity.
However, we don't have a concrete use case for such reoptimization yet. I
think we could better design and validate the implementation once we have a
concrete motivation for running `JoinSelection` after `EnsureRequirements`. So
I'd prefer to keep it simple for now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]