Skip to content

Commit

Permalink
Fix bug in depth calculation for list of struct columns
Browse files Browse the repository at this point in the history
Signed-off-by: Yan Feng <[email protected]>
  • Loading branch information
ustcfy committed Dec 6, 2024
1 parent 2e44509 commit c0f7ec0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/cpp/src/xxhash64.cu
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,13 @@ void check_nested_depth(cudf::table_view const& input)

column_checker_fn_t get_nested_depth = [&](cudf::column_view const& col) {
if (col.type().id() == cudf::type_id::LIST) {
// list column will be replaced by its most inner non-list child
return get_nested_depth(cudf::lists_column_view(col).child());
auto const& child_col = cudf::lists_column_view(col).child();
// When encountering a List of Struct column, we need to account for an extra depth,
// as both the struct column and its elements will be pushed into the stack.
if (child_col.type().id() == cudf::type_id::STRUCT) {
return 1 + get_nested_depth(child_col);
}
return get_nested_depth(child_col);
} else if (col.type().id() == cudf::type_id::STRUCT) {
int max_child_depth = 0;
for (auto child = col.child_begin(); child != col.child_end(); ++child) {
Expand Down

0 comments on commit c0f7ec0

Please sign in to comment.