[Minor] Move combine_join util to under equivalence.rs#7917
Merged
ozankabak merged 3 commits intoapache:mainfrom Oct 24, 2023
synnada-ai:refactor/move_combine_join_to_equivalence
Merged
[Minor] Move combine_join util to under equivalence.rs#7917ozankabak merged 3 commits intoapache:mainfrom synnada-ai:refactor/move_combine_join_to_equivalence
ozankabak merged 3 commits intoapache:mainfrom
synnada-ai:refactor/move_combine_join_to_equivalence
Conversation
mustafasrepo
commented
Oct 24, 2023
| } | ||
|
|
||
| /// Combine equivalence properties of the given join inputs. | ||
| pub fn combine_join_equivalence_properties( |
Contributor
Author
There was a problem hiding this comment.
This function is copy-pasted
mustafasrepo
commented
Oct 24, 2023
| } | ||
|
|
||
| /// Calculate equivalence properties for the given cross join operation. | ||
| pub fn cross_join_equivalence_properties( |
Contributor
Author
There was a problem hiding this comment.
This function is copy-pasted
mustafasrepo
commented
Oct 24, 2023
| /// | ||
| /// This way; once we normalize an expression according to equivalence properties, | ||
| /// it can thereafter safely be used for ordering equivalence normalization. | ||
| fn get_updated_right_ordering_equivalent_class( |
Contributor
Author
There was a problem hiding this comment.
This function is copy pasted
mustafasrepo
commented
Oct 24, 2023
Comment on lines
+1048
to
+1056
| for left_ordering in left_oeq_class.iter() { | ||
| for right_ordering in updated_right_oeq.iter() { | ||
| let mut ordering = left_ordering.to_vec(); | ||
| ordering.extend(right_ordering.to_vec()); | ||
| let ordering_normalized = | ||
| join_eq_properties.normalize_sort_exprs(&ordering); | ||
| orderings.push(ordering_normalized); | ||
| } | ||
| } |
Contributor
Author
There was a problem hiding this comment.
Previously we were prefixing with left ordering. We now prefix with all of the orderings inside left equivalence. We no longer use left output_ordering. This is the only change. in this function.
mustafasrepo
commented
Oct 24, 2023
Comment on lines
+1099
to
+1107
| for right_ordering in right_oeg_class.iter() { | ||
| for left_ordering in left_oeq_class.iter() { | ||
| let mut ordering = right_ordering.to_vec(); | ||
| ordering.extend(left_ordering.to_vec()); | ||
| let ordering_normalized = | ||
| join_eq_properties.normalize_sort_exprs(&ordering); | ||
| orderings.push(ordering_normalized); | ||
| } | ||
| } |
Contributor
Author
There was a problem hiding this comment.
Similar to above comment. However, in this case left orderings are prefixed with right orderings
mustafasrepo
commented
Oct 24, 2023
| } | ||
|
|
||
| #[test] | ||
| fn test_get_updated_right_ordering_equivalence_properties() -> Result<()> { |
Contributor
Author
There was a problem hiding this comment.
This test is copy-pasted
alamb
approved these changes
Oct 24, 2023
Contributor
alamb
left a comment
There was a problem hiding this comment.
looks like a nice change to me -- thank you @mustafasrepo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #.
Rationale for this change
Utils to construct
join_equivalenceandjoin_ordering_equivalenceare move underequivalence.rsfile. Computations regarding the equivalence and ordering equivalence are gathered in theequivalence.rsfile. With this change code organization is bit better.What changes are included in this PR?
Are these changes tested?
Are there any user-facing changes?