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

Fix row group alignment in ORC writer #15789

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions cpp/src/io/orc/writer_impl.cu
Original file line number Diff line number Diff line change
Expand Up @@ -782,8 +782,16 @@ std::vector<std::vector<rowgroup_rows>> calculate_aligned_rowgroup_bounds(
} else {
// pushdown mask present; null mask bits w/ set pushdown mask bits will be encoded
// Use the number of set bits in pushdown mask as size
auto bits_to_borrow =
8 - (d_pd_set_counts[rg_idx][parent_col_idx] - previously_borrowed) % 8;
auto bits_to_borrow = [&]() {
if (d_pd_set_counts[rg_idx][parent_col_idx] < previously_borrowed) {
// Borrow to make make an empty rowgroup
vuule marked this conversation as resolved.
Show resolved Hide resolved
return previously_borrowed - d_pd_set_counts[rg_idx][parent_col_idx];
}
auto const misalignment =
(d_pd_set_counts[rg_idx][parent_col_idx] - previously_borrowed) % 8;
return (misalignment == 0) ? 0 : (8 - misalignment);
vuule marked this conversation as resolved.
Show resolved Hide resolved
vuule marked this conversation as resolved.
Show resolved Hide resolved
}();

if (bits_to_borrow == 0) {
// Didn't borrow any bits for this rowgroup
previously_borrowed = 0;
Expand Down
Loading