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 3 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
10 changes: 4 additions & 6 deletions cpp/src/io/parquet/writer_impl.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1706,14 +1706,12 @@ 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;
std::vector<size_type> frag_offsets(num_columns, 0);
vuule marked this conversation as resolved.
Show resolved Hide resolved
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];
std::exclusive_scan(
frags_per_column.begin(), frags_per_column.end(), frag_offsets.begin(), 0);
return frag_offsets.back() + frags_per_column.back();
} else {
return 0;
}
Expand Down