From 1a3593ac4ccd8535014cc0bf17cb4c241474f325 Mon Sep 17 00:00:00 2001 From: David Wendt Date: Wed, 19 Aug 2026 13:43:12 -0400 Subject: [PATCH 1/2] Handle large strings offsets in cudf::byte_cast API --- cpp/src/reshape/byte_cast.cu | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/cpp/src/reshape/byte_cast.cu b/cpp/src/reshape/byte_cast.cu index 3e563a93cd1e..2d629df6faab 100644 --- a/cpp/src/reshape/byte_cast.cu +++ b/cpp/src/reshape/byte_cast.cu @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION. + * SPDX-FileCopyrightText: Copyright (c) 2020-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 */ @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -130,12 +131,16 @@ struct byte_list_conversion_fn( output_type, num_chars, std::move(*(col_content.data)), rmm::device_buffer{}, 0); - auto result = make_lists_column( - input.size(), - std::move(col_content.children[cudf::strings_column_view::offsets_column_index]), - std::move(uint8_col), - input.null_count(), - detail::copy_bitmask(input, stream, mr)); + auto offsets_col = std::move(col_content.children[strings_column_view::offsets_column_index]); + if (offsets_col->type().id() != type_id::INT32) { + offsets_col = cudf::detail::cast(offsets_col->view(), data_type{type_id::INT32}, stream, mr); + } + + auto result = make_lists_column(input.size(), + std::move(offsets_col), + std::move(uint8_col), + input.null_count(), + detail::copy_bitmask(input, stream, mr)); // If any nulls are present, the corresponding lists must be purged so that // the result is sanitized. From bf9d22c60296f455224d94323a290c58739ad45a Mon Sep 17 00:00:00 2001 From: David Wendt Date: Thu, 27 Aug 2026 15:42:13 -0400 Subject: [PATCH 2/2] size_type to int32_t --- cpp/src/reshape/byte_cast.cu | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/src/reshape/byte_cast.cu b/cpp/src/reshape/byte_cast.cu index d9670771d63b..97c5892cce7d 100644 --- a/cpp/src/reshape/byte_cast.cu +++ b/cpp/src/reshape/byte_cast.cu @@ -122,7 +122,7 @@ struct byte_list_conversion_fn(std::numeric_limits::max()), + CUDF_EXPECTS(num_chars < static_cast(std::numeric_limits::max()), "Cannot convert strings column to lists column due to size_type limit", std::overflow_error);