-
Notifications
You must be signed in to change notification settings - Fork 847
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
feat: call try_merge recursively for list field #5852
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.
Thank you for the contribution @mnpw -- this PR makes sense to me.
Nicely tested as well 👍
Let me know about DataType::LargeList
@@ -483,6 +483,18 @@ impl Field { | |||
)); | |||
} | |||
}, | |||
DataType::List(field) => match &from.data_type { |
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.
I think we should also add support for DataType::LargeList
https://docs.rs/arrow/latest/arrow/datatypes/enum.DataType.html#variant.LargeList
If you don't want to add it in this PR, I'll file a ticket to track and add it in a follow on
Thanks @alamb for the review. As per your suggestion I have added the change for |
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 @mnpw
I noticed that this PR is marked "breaking" but it seems to me like it isn't a breaking API change (in the sense that code that compiles before this PR will also compile after this PR)
struct1 | ||
); | ||
|
||
let mut list1 = Field::new( |
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.
Any chance we could add a test for LargeList
too?
I added Lmk if this looks good |
Thanks @mnpw |
Thanks again @mnpw |
Which issue does this PR close?
Closes #5843.
Rationale for this change
Merging fields recursively is already performed for a field with datatype Struct. This PR extends that recursive merge to fields with List and LargeList datatypes.
What changes are included in this PR?
Field::try_merge
to call merge recursively if datatype is List and LargeListAre there any user-facing changes?
N/A