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

Superimpose null masks for STRUCT columns. #9144

Merged
merged 7 commits into from
Sep 2, 2021

Conversation

mythrocks
Copy link
Contributor

Per #5700, when a STRUCT column is constructed, the null mask of the parent
column is bitwise-ANDed with that of all its children, such that a null row
in the parent column corresponds to nulls in all its children. This is done
recursively, allowing grand-child columns to also have nulls at the same
row positions.

superimpose_parent_nulls() makes this functionality available for columns
that might not have been constructed through make_struct_column(), e.g.
with columns received directly from Arrow. It does not require that the
column_view is modifiable. For a STRUCT column_view argument, a new
equivalent instance is created, with all its children's null masks modified
to account for the parent nulls.

superimpose_parent_nulls() can be used for all code that assumes that the
child null masks account for the nulls in the parents (and grandparents,
ad infinitum).

Per rapidsai#5700, when a STRUCT column is constructed, the null mask of the parent
column is bitwise-ANDed with that of all its children, such that a null row
in the parent column corresponds to nulls in all its children. This is done
recursively, allowing grand-child columns to also have nulls at the same
row positions.

`superimpose_parent_nulls()` makes this functionality available for columns
that might not have been constructed through `make_struct_column()`, e.g.
with columns received directly from Arrow. It does not require that the
`column_view` is modifiable. For a STRUCT `column_view` argument, a new
equivalent instance is created, with all its children's null masks modified
to account for the parent nulls.

`superimpose_parent_nulls()` can be used for all code that assumes that the
child null masks account for the nulls in the parents (and grandparents,
ad infinitum).
@mythrocks mythrocks requested a review from a team as a code owner August 30, 2021 17:59
@github-actions github-actions bot added the libcudf Affects libcudf (C++/CUDA) code. label Aug 30, 2021
@mythrocks mythrocks self-assigned this Aug 30, 2021
@mythrocks mythrocks added feature request New feature or request non-breaking Non-breaking change labels Aug 30, 2021
@mythrocks mythrocks added the 3 - Ready for Review Ready for review by team label Aug 30, 2021
@codecov
Copy link

codecov bot commented Aug 30, 2021

Codecov Report

❗ No coverage uploaded for pull request base (branch-21.10@1935a8a). Click here to learn what that means.
The diff coverage is n/a.

❗ Current head 87686c1 differs from pull request most recent head cc8e566. Consider uploading reports for the commit cc8e566 to get more accurate results
Impacted file tree graph

@@               Coverage Diff               @@
##             branch-21.10    #9144   +/-   ##
===============================================
  Coverage                ?   10.82%           
===============================================
  Files                   ?      115           
  Lines                   ?    19122           
  Branches                ?        0           
===============================================
  Hits                    ?     2070           
  Misses                  ?    17052           
  Partials                ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1935a8a...cc8e566. Read the comment docs.

cpp/src/structs/utilities.hpp Show resolved Hide resolved
cpp/src/structs/utilities.hpp Outdated Show resolved Hide resolved
cpp/src/structs/utilities.hpp Outdated Show resolved Hide resolved
cpp/tests/structs/utilities_tests.cpp Outdated Show resolved Hide resolved
cpp/tests/structs/utilities_tests.cpp Outdated Show resolved Hide resolved
cpp/src/structs/utilities.hpp Outdated Show resolved Hide resolved
cpp/src/structs/utilities.hpp Outdated Show resolved Hide resolved
cpp/src/structs/utilities.hpp Show resolved Hide resolved
Copy link
Contributor

@codereport codereport left a comment

Choose a reason for hiding this comment

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

👍

@mythrocks mythrocks requested review from jrhemstad and removed request for devavret September 1, 2021 22:11
@mythrocks
Copy link
Contributor Author

Thanks for the reviews, chaps. I've taken @devavret off the review, since @ttnghia has reviewed it too.
I'll merge this if/when the CI tests pass.

@mythrocks
Copy link
Contributor Author

@gpucibot merge

@rapids-bot rapids-bot bot merged commit cd4c8c7 into rapidsai:branch-21.10 Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team feature request New feature or request libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants