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

Add value tracking to ConstExpr for improved union optimization #47

Closed

Conversation

gokselk
Copy link

@gokselk gokselk commented Nov 19, 2024

Which issue does this PR close?

Closes #.

Rationale for this change

What changes are included in this PR?

Are these changes tested?

Are there any user-facing changes?

Copy link
Collaborator

@berkaysynnada berkaysynnada left a comment

Choose a reason for hiding this comment

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

LGTM @gokselk. You can open this PR to upstream as well after addressing my last suggestions.

@@ -62,11 +62,12 @@ pub struct ConstExpr {
/// Does the constant have the same value across all partitions? See
/// struct docs for more details
across_partitions: bool,
value: Option<ScalarValue>
}

impl PartialEq for ConstExpr {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't we auto-derive PartialEq for ConstantExpr's?

Copy link
Author

Choose a reason for hiding this comment

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

Not possible due to a Rust bug, details here: apache#13196

datafusion/physical-expr/src/equivalence/class.rs Outdated Show resolved Hide resolved
datafusion/physical-expr/src/equivalence/properties.rs Outdated Show resolved Hide resolved
@gokselk gokselk force-pushed the feature/const-expr-value-tracking branch from 1a81628 to f737c65 Compare December 19, 2024 07:38
@ozankabak
Copy link
Collaborator

Merged upstream.

@ozankabak ozankabak closed this Dec 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants