Skip to content
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

Add in more generalized support for casting nested types #3162

Merged
merged 8 commits into from
Aug 6, 2021

Conversation

revans2
Copy link
Collaborator

@revans2 revans2 commented Aug 6, 2021

This fixes #3156
This does not depend on rapidsai/cudf#8985, but it does help a lot with reducing unneeded data movement.

This adds support for casting structs to structs and maps to maps. It also generalizes support for casting arrays to arrays so that more types are supported. It also fixed a number of bugs in casting nested types.

I also added in an optimization from the original Spark cast code that checks to see if the types are structurally the same, meaning only the names of the fields in the struct changed, and if they are then it does not need to actually bother with the cast.

@revans2 revans2 added this to the Aug 2 - Aug 13 milestone Aug 6, 2021
@revans2 revans2 self-assigned this Aug 6, 2021
@revans2
Copy link
Collaborator Author

revans2 commented Aug 6, 2021

build

Signed-off-by: Robert (Bobby) Evans <[email protected]>
@revans2
Copy link
Collaborator Author

revans2 commented Aug 6, 2021

build

Copy link
Contributor

@jlowe jlowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor typos but otherwise lgtm.

jlowe
jlowe previously approved these changes Aug 6, 2021
@revans2
Copy link
Collaborator Author

revans2 commented Aug 6, 2021

build

@revans2
Copy link
Collaborator Author

revans2 commented Aug 6, 2021

build

@revans2 revans2 marked this pull request as draft August 6, 2021 17:52
@revans2
Copy link
Collaborator Author

revans2 commented Aug 6, 2021

Got some scary test failures. Looking into it more.

@revans2 revans2 marked this pull request as ready for review August 6, 2021 19:20
@revans2
Copy link
Collaborator Author

revans2 commented Aug 6, 2021

build

@revans2
Copy link
Collaborator Author

revans2 commented Aug 6, 2021

There was a small bug in the existing cast code where it was using the member value dataType for the to cast type instead of going off of what was passed in. I had already fixed several issues like this, but I didn't know if I had gotten them all. So I moved all of the casting methods to an object so there was no chance of it happening. The code is a bit more verbose now, because we have to pass around a few boolean flags, but there is no chance of re-introducing the bug without a lot of effort.

@revans2 revans2 merged commit aae8875 into NVIDIA:branch-21.10 Aug 6, 2021
@revans2 revans2 deleted the cast_struct_to_struct branch August 6, 2021 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEA] Support casting struct to struct
3 participants