diff --git a/cpp/src/io/parquet/page_enc.cu b/cpp/src/io/parquet/page_enc.cu index 3c62dcf7eea..20a7ab7ca6d 100644 --- a/cpp/src/io/parquet/page_enc.cu +++ b/cpp/src/io/parquet/page_enc.cu @@ -1966,9 +1966,9 @@ dremel_data get_dremel_data(column_view h_col, // Scan to get distance by which each offset value is shifted due to the insertion of empties auto scan_it = cudf::detail::make_counting_transform_iterator( - column_offsets[level], [off = lcv.offsets().data()] __device__(auto i) -> int { - return off[i] == off[i + 1]; - }); + column_offsets[level], + [off = lcv.offsets().data(), size = lcv.offsets().size()] __device__( + auto i) -> int { return (i + 1 < size) && (off[i] == off[i + 1]); }); rmm::device_uvector scan_out(offset_size_at_level, stream); thrust::exclusive_scan( rmm::exec_policy(stream), scan_it, scan_it + offset_size_at_level, scan_out.begin()); @@ -2053,9 +2053,9 @@ dremel_data get_dremel_data(column_view h_col, // Scan to get distance by which each offset value is shifted due to the insertion of dremel // level value fof an empty list auto scan_it = cudf::detail::make_counting_transform_iterator( - column_offsets[level], [off = lcv.offsets().data()] __device__(auto i) -> int { - return off[i] == off[i + 1]; - }); + column_offsets[level], + [off = lcv.offsets().data(), size = lcv.offsets().size()] __device__( + auto i) -> int { return (i + 1 < size) && (off[i] == off[i + 1]); }); rmm::device_uvector scan_out(offset_size_at_level, stream); thrust::exclusive_scan( rmm::exec_policy(stream), scan_it, scan_it + offset_size_at_level, scan_out.begin());