Minor: make LeftJoinData into a struct in CrossJoinExec#13227
Merged
Dandandan merged 1 commit intoapache:mainfrom Nov 4, 2024
Merged
Minor: make LeftJoinData into a struct in CrossJoinExec#13227Dandandan merged 1 commit intoapache:mainfrom
Dandandan merged 1 commit intoapache:mainfrom
Conversation
alamb
commented
Nov 1, 2024
| /// Data of the left side | ||
| type JoinLeftData = (RecordBatch, MemoryReservation); | ||
| #[derive(Debug)] | ||
| struct JoinLeftData { |
Contributor
Author
There was a problem hiding this comment.
The point of the PR is to name this tuple and add comments
findepi
approved these changes
Nov 2, 2024
findepi
reviewed
Nov 2, 2024
Comment on lines
+56
to
+57
| #[allow(dead_code)] | ||
| reservation: MemoryReservation, |
Member
There was a problem hiding this comment.
Apparently this can be also written without disabling a lint:
Suggested change
| #[allow(dead_code)] | |
| reservation: MemoryReservation, | |
| _reservation: MemoryReservation, |
#[allow(dead_code)]has disadvantage that it can be retained in the code even if the field becomes used_reservationhas disadvantage that it doesn't look pretty
Contributor
There was a problem hiding this comment.
Pretty or not, _reservation is the language-appropriate idiom.
Contributor
Author
There was a problem hiding this comment.
Filed #13278 to track. Thank you for the suggestion
Dandandan
approved these changes
Nov 4, 2024
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
I was in this code for #13223 and #13203 and noticed the use of the unnamed tuple
By giving the fields names I think it becomes easier to read and comment, as well as more consistent with the other joins (like HashJoinExec):
datafusion/datafusion/physical-plan/src/joins/hash_join.rs
Lines 82 to 83 in 2047d7f
What changes are included in this PR?
Change from a tuple to a named struct
Are these changes tested?
By existing CI
Are there any user-facing changes?