Skip to content

Refactor EliminateOuterJoin to implement OptimizerRule::rewrite() #10081

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged

Conversation

peter-toth
Copy link
Contributor

Which issue does this PR close?

Part of #9637.

Rationale for this change

Eliminates a LogicalPlan::with_new_exprs() call and so Expr cloning.

What changes are included in this PR?

This PR:

  • Refactors EliminateOuterJoin::try_optimize() to EliminateOuterJoin::rewrite().
  • Contains minor cleanup of eliminate_outer().
  • Fixes typo in SimplifyExpressions.

Are these changes tested?

Yes, with existing UTs.

Are there any user-facing changes?

No.

Copy link
Contributor

@jayzhan211 jayzhan211 left a comment

Choose a reason for hiding this comment

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

👍

@@ -53,7 +53,7 @@ impl OptimizerRule for SimplifyExpressions {
_plan: &LogicalPlan,
_config: &dyn OptimizerConfig,
) -> Result<Option<LogicalPlan>> {
internal_err!("Should have called SimplifyExpressions::try_optimize_owned")
internal_err!("Should have called SimplifyExpressions::rewrite")
Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you

@alamb alamb merged commit 74c7e52 into apache:main Apr 15, 2024
24 checks passed
@peter-toth
Copy link
Contributor Author

Thanks @jayzhan211, @alamb for the review!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
optimizer Optimizer rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants