Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
vuule committed Apr 6, 2022
1 parent 031e9da commit 82b437d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cpp/src/io/parquet/reader_impl.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1179,16 +1179,18 @@ rmm::device_buffer reader::impl::decompress_page_data(
codec_stats{parquet::SNAPPY, 0, 0},
codec_stats{parquet::BROTLI, 0, 0}};

auto is_codec_supported = [&](int8_t codec) {
auto is_codec_supported = [&codecs](int8_t codec) {
if (codec == parquet::UNCOMPRESSED) return true;
return std::find_if(codecs.begin(), codecs.end(), [codec](auto& cstats) {
return codec == cstats.compression_type;
}) != codecs.end();
};
CUDF_EXPECTS(
std::all_of(
chunks.begin(), chunks.end(), [&](auto& chunk) { return is_codec_supported(chunk.codec); }),
"Unsupported compression type");
CUDF_EXPECTS(std::all_of(chunks.begin(),
chunks.end(),
[&is_codec_supported](auto const& chunk) {
return is_codec_supported(chunk.codec);
}),
"Unsupported compression type");

for (auto& codec : codecs) {
for_each_codec_page(codec.compression_type, [&](size_t page) {
Expand Down

0 comments on commit 82b437d

Please sign in to comment.