-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Convert LexOrdering type to struct.
#13146
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
Convert LexOrdering type to struct.
#13146
Conversation
7ba63c3 to
bf53894
Compare
… `unwrap_or` to `unwrap_or_default`.
…LexOrdering and LexOrderingRef.
types to structs.
types to structs.type to struct.
|
I initially also converted |
berkaysynnada
left a 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.
LGTM, thank you @ngli-me. Just have a few minor suggestions
335339a to
e99e386
Compare
alamb
left a 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.
This is amazing -- thank you @ngli-me and @berkaysynnada
I think we can make it even better and remove LexOrderingRef in favor of &LexOrdering but we can do so as a follow on PR.
I am exploring how to do this
|
Thank you again @ngli-me and @berkaysynnada I filed some follow on work:
I also double checked that when I merged this branch up to main it still passed all its tests |
* Conversion types for LexOrdering and LexOrderingRef to structs. * Format and fix type errors. Adjusted expected output when using `LexOrdering`. * Updated usage of `FromIterator` and removed `empty()` in favor of `default()`. * Adjusted chained `map` and `flatten` calls to `flat_map`, and swapped `unwrap_or` to `unwrap_or_default`. * Adjusted slt files to include a space after commas, when relating to LexOrdering and LexOrderingRef. * Removed unnecessary path prefixes in `sort_expr`. * Fixed tpch slt files. * Removed LexOrderingRef struct. * Removed dereferences to `LexOrderingRef` left over from the struct removal. * Removed remaining usage of the raw `LexOrderingRef` type. * Formatting. * Apply suggestions from code review, along with formatting. * Merged with main. * Merged with main. --------- Co-authored-by: nglime <git@ngli.me> (cherry picked from commit 752561a)
Which issue does this PR close?
Closes #12591.
Rationale for this change
What changes are included in this PR?
Adds
LexOrderingas a struct, instead of a type.Replaces previous occurrences of
LexOrderingof thetypewithstructwhere appropriate.Replaces
&[PhysicalSortExpr]with the typeLexOrderingRef, where appropriate.Aligns printing for
LexOrdering, since some instances of aPhysicalSortExprwere being printed with,, and others with,. Changed printing over to the latter, since this seems to align more with other instances of printing multiple items.Are these changes tested?
Yes, adjusted tests where necessary.
Are there any user-facing changes?
The Vec needs to be wrapped to initialize the struct instance, and some of the usage needs to be adjusted to get the field from the struct.