Merged
Conversation
eddyxu
reviewed
May 8, 2023
| } | ||
| } | ||
|
|
||
| fn merge(left_fields: Vec<FieldRef>, |
Member
There was a problem hiding this comment.
Why does it need the ownership of these fields?
| fn merge(left_fields: Vec<FieldRef>, | ||
| left_columns: Vec<ArrayRef>, | ||
| right_fields: Vec<FieldRef>, | ||
| right_columns: Vec<ArrayRef>) -> (Vec<FieldRef>, Vec<ArrayRef>) { |
Member
There was a problem hiding this comment.
is Vec<FieldRef> + Vec<ArrayRef> to be a RecordBatch?
Contributor
Author
There was a problem hiding this comment.
yes, RecordBatch constructor takes list of tuple (field, array ref)
| let left_struct_array = as_struct_array(column); | ||
| let right_struct_array = as_struct_array(right_column.as_ref()); | ||
| let (merged_fields, merged_columns) = merge( | ||
| left_sub_fields.iter().cloned().collect::<Vec<_>>(), |
Member
There was a problem hiding this comment.
Why need to copy the fields / array? Can it use a slice of array?
| ))); | ||
| } | ||
| // otherwise, just use the field on the left hand side | ||
| _ => { |
Member
There was a problem hiding this comment.
should you check left / right fields are not compabile?
|
|
||
| fn merge(left_fields: Vec<FieldRef>, | ||
| left_columns: Vec<ArrayRef>, | ||
| right_fields: Vec<FieldRef>, |
Member
There was a problem hiding this comment.
Also why separate columns and fields to two different params?
eddyxu
approved these changes
May 8, 2023
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.
If we're merging two record batches with struct fields then the existing merge method is insufficient. Instead we need to check for struct fields and do a recursive merge