Skip to content

Commit

Permalink
Add more explanation to the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ttnghia committed May 26, 2021
1 parent 5596785 commit 224eb13
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cpp/src/structs/utilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,16 @@ struct flattened_table {
{
// Even if it is not required to extract the bitmask to a separate column,
// we should always do that if the structs column has any null element.
//
// In addition, we should check for null by calling to `has_nulls()`, not `nullable()`.
// This is because when comparing structs columns, if one column has bitmask while the other
// does not (and both columns do not have any null element) then flattening them using
// `nullable()` will result in tables with different number of columns.
//
// Notice that, for comparing structs columns when one column has null while the other
// doesn't, `nullability` must be passed in with value `column_nullability::FORCE` to make
// sure the flattening results are tables having the same number of columns.

if (nullability == column_nullability::FORCE || col.has_nulls()) {
validity_as_column.push_back(cudf::is_valid(col));
if (col.has_nulls()) {
Expand Down

0 comments on commit 224eb13

Please sign in to comment.