diff --git a/cpp/include/cudf/strings/detail/strings_column_factories.cuh b/cpp/include/cudf/strings/detail/strings_column_factories.cuh index 932f7eb0926..92cf537454c 100644 --- a/cpp/include/cudf/strings/detail/strings_column_factories.cuh +++ b/cpp/include/cudf/strings/detail/strings_column_factories.cuh @@ -93,10 +93,10 @@ std::unique_ptr make_strings_column(IndexPairIterator begin, auto null_mask = (null_count > 0) ? std::move(new_nulls.first) : rmm::device_buffer{0, stream, mr}; + auto const avg_bytes_per_row = bytes / std::max(strings_count - null_count, 1); // build chars column std::unique_ptr chars_column = [&] { // use a character-parallel kernel for long string lengths - auto const avg_bytes_per_row = bytes / std::max(strings_count - null_count, 1); if (avg_bytes_per_row > FACTORY_BYTES_PER_ROW_THRESHOLD) { auto const d_offsets = device_span{offsets_column->view().template data(),