diff --git a/cpp/src/strings/combine/join.cu b/cpp/src/strings/combine/join.cu index 4b2996a77e4..2e30e01df21 100644 --- a/cpp/src/strings/combine/join.cu +++ b/cpp/src/strings/combine/join.cu @@ -162,16 +162,16 @@ std::unique_ptr join_strings(strings_column_view const& input, return std::move(*chars_data); }(); + // API returns a single output row which cannot exceed row limit(max of size_type). + CUDF_EXPECTS(chars.size() < static_cast(std::numeric_limits::max()), + "The output exceeds the row size limit", + std::overflow_error); + // build the offsets: single string output has offsets [0,chars-size] auto offsets_column = [&] { - if (chars.size() < static_cast(get_offset64_threshold())) { - auto offsets32 = cudf::detail::make_device_uvector_async( - std::vector({0, static_cast(chars.size())}), stream, mr); - return std::make_unique(std::move(offsets32), rmm::device_buffer{}, 0); - } - auto offsets64 = cudf::detail::make_device_uvector_async( - std::vector({0L, static_cast(chars.size())}), stream, mr); - return std::make_unique(std::move(offsets64), rmm::device_buffer{}, 0); + auto offsets = cudf::detail::make_device_uvector_async( + std::vector({0, static_cast(chars.size())}), stream, mr); + return std::make_unique(std::move(offsets), rmm::device_buffer{}, 0); }(); // build the null mask: only one output row so it is either all-valid or all-null