-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[refactor]: Convert Vec<PhysicalExpr> to HashSet<PhysicalExpr> #13612
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice improvement! Thanks @akurmustafa 👍
@@ -191,46 +190,48 @@ pub struct EquivalenceClass { | |||
/// matter for equivalence purposes | |||
/// | |||
/// TODO: use a HashSet for this instead of a Vec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove this comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, missed it
Co-authored-by: Alex Huang <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome -- thanks @akurmustafa and @Weijun-H -- I am also running some benchmarks to see if it improves performance for planning
Self { exprs } | ||
pub fn new(exprs: Vec<Arc<dyn PhysicalExpr>>) -> Self { | ||
Self { | ||
exprs: exprs.into_iter().collect(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
Thanks @akurmustafa and @alamb |
Hmm, I seem to see a slight slow down in planning 🤔 maybe worth some profiling
|
track #13638 |
Which issue does this PR close?
Closes #.
Rationale for this change
Vec<Arc<dynPhysicalExpr>>
s insideEquivalenceClass
is conceptually set. Previously, sinceArc<dyn PhysicalExpr>
didnot supportEq
, we couldn't use it insideHashSet
(orIndexSet
). With recent changes in Datafusion, we can do so now. This PR convertsVec<Arc<dynPhysicalExpr>>
intoIndexSet<Arc<dynPhysicalExpr>>
to make implementation simpler.What changes are included in this PR?
Are these changes tested?
Existing tests
Are there any user-facing changes?