-
Notifications
You must be signed in to change notification settings - Fork 928
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
[BUG] gathering structs can produce valid child values underneath null struct parent #9188
Comments
This appears to be fixed with the following patch. I noticed the logic at https://github.com/rapidsai/cudf/blob/branch-21.10/cpp/include/cudf/detail/gather.cuh#L663-L666 was not being applied in the struct column handling of child columns.
I'm guessing this wasn't caught by the unit tests since they are using nullable child columns. |
Yeah that is because when implemented it I used the assumption that the children columns have always been superimposed their parent nulls onto. |
In this case the input columns are correctly reflecting the parent nullability. Nothing is nullable in the input, parent struct or otherwise, yet it produces the wrong output. When |
Thanks Jason. That's definitely my bug. Thanks @mythrocks for taking over this. I'm sorry that it costs you guys time to deal with it 😞 |
Fixes rapidsai#9188. Prior to this fix, when `cudf::gather()` is called on a STRUCT input column, the null masks of the children of the result column would not be set correctly if the child columns do not contain nulls. This fix enforces null mask calculation if NULLIFY is set.
Fixes rapidsai#9188. Prior to this fix, when `cudf::gather()` is called on a STRUCT input column, the null masks of the children of the result column would not be set correctly if the child columns do not contain nulls. This fix enforces null mask calculation if NULLIFY is set.
It was a subtle bug. :/ I've been operating under the assumption that it was my doing. :] If my |
Fixes #9188. Prior to this fix, when `cudf::gather()` is called on a STRUCT input column, the null masks of the children of the result column would not be set correctly if the child columns do not contain nulls. This fix enforces null mask calculation if `NULLIFY` is set. In addition, this commit also cleans up the `TypedStructGatherTest` test suite: 1. IIFEs for `STRUCT` column construction. 2. Corrections for `assert()` conditions. 3. Switched `column` construction to `column_wrapper` and `column_view`. 4. Corrected the output null mask for `TestGatherStructOfListOfStructs`. 5. Added repro test for #9188. Authors: - MithunR (https://github.com/mythrocks) Approvers: - Nghia Truong (https://github.com/ttnghia) - Jason Lowe (https://github.com/jlowe) - Karthikeyan (https://github.com/karthikeyann) URL: #9194
Describe the bug
Performing a gather on a non-nullable struct column with non-nullable child columns can produce a result where the parent has null rows but the corresponding child rows are not null.
Steps/Code to reproduce bug
Create a non-nullable struct column with non-nullable child columns and perform a gather with some of the gather map indices being out-of-bounds (i.e.: -1) and specify that out-of-bounds gather indices should result in null values during the gather.
Expected behavior
If the gather operation introduces a null struct row, the corresponding child rows should also be null.
The text was updated successfully, but these errors were encountered: