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 invalid use of std::exclusive_scan in Parquet writer #13434

Merged
merged 6 commits into from
May 25, 2023
Merged
Changes from all commits
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
16 changes: 4 additions & 12 deletions cpp/src/io/parquet/writer_impl.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1706,18 +1706,10 @@ auto convert_table_to_parquet_data(table_input_metadata& table_meta,
// fragments with a (potentially) varying number of fragments per column.

// first figure out the total number of fragments and calculate the start offset for each column
std::vector<size_type> frag_offsets;
size_type const total_frags = [&]() {
if (frags_per_column.size() > 0) {
std::exclusive_scan(frags_per_column.data(),
frags_per_column.data() + num_columns + 1,
std::back_inserter(frag_offsets),
0);
return frag_offsets[num_columns];
} else {
return 0;
}
}();
std::vector<size_type> frag_offsets(num_columns, 0);
vuule marked this conversation as resolved.
Show resolved Hide resolved
std::exclusive_scan(frags_per_column.begin(), frags_per_column.end(), frag_offsets.begin(), 0);
size_type const total_frags =
frags_per_column.empty() ? 0 : frag_offsets.back() + frags_per_column.back();

rmm::device_uvector<statistics_chunk> frag_stats(0, stream);
hostdevice_vector<gpu::PageFragment> page_fragments(total_frags, stream);
Expand Down