Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Stop copying LogicalPlan and Exprs in PropagateEmptyRelation #10332

Merged

Conversation

demetribu
Copy link
Contributor

Which issue does this PR close?

Closes #10290.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

@github-actions github-actions bot added the optimizer Optimizer rules label May 1, 2024
@demetribu demetribu force-pushed the 10290-optimise-propagate-empty-relation branch from 5b6a4fc to 95eb2d6 Compare May 1, 2024 18:15
@demetribu demetribu force-pushed the 10290-optimise-propagate-empty-relation branch from 95eb2d6 to 2edfff4 Compare May 1, 2024 18:16
@alamb alamb changed the title Optimized propagation of empty relations #10290 Stop copying LogicalPlan and Exprs in PropagateEmptyRelation May 2, 2024
Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @dmitrybugakov -- this looks very nice. I took a look at empty_child

fn empty_child(plan: &LogicalPlan) -> Result<Option<LogicalPlan>> {
and while in theory it recreates an new plan node when it could reuse the existing one, I don't think that will matter in practice

Thanks again -- really nice to see these contributions

@@ -290,6 +291,32 @@ fn eliminate_nested_filters() {
assert_eq!(expected, format!("{plan:?}"));
}

#[test]
fn test_propagate_empty_relation_inner_join_and_unions() {
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️ for the additional coverage

@alamb alamb merged commit 63e05fa into apache:main May 2, 2024
24 checks passed
@demetribu demetribu deleted the 10290-optimise-propagate-empty-relation branch May 2, 2024 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimizer Optimizer rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stop copying LogicalPlan and Exprs in PropagateEmptyRelation
2 participants