From ee5b7fd333684a6bee2e50af08791c7b8755d430 Mon Sep 17 00:00:00 2001 From: Nghia Truong Date: Thu, 10 Oct 2024 13:38:13 -0700 Subject: [PATCH] Discard null mask if there is no nulls Signed-off-by: Nghia Truong --- cpp/src/strings/strings_column_factories.cu | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cpp/src/strings/strings_column_factories.cu b/cpp/src/strings/strings_column_factories.cu index bfccfb76cba..9564517f4e7 100644 --- a/cpp/src/strings/strings_column_factories.cu +++ b/cpp/src/strings/strings_column_factories.cu @@ -191,11 +191,14 @@ std::vector> make_strings_column_batch( strings_count, stream, mr); - output[idx] = make_strings_column(strings_count, - std::move(offsets_cols[idx]), - chars_data.release(), - strings_count - valid_count, - std::move(null_masks[idx])); + + auto const null_count = strings_count - valid_count; + output[idx] = + make_strings_column(strings_count, + std::move(offsets_cols[idx]), + chars_data.release(), + null_count, + null_count ? std::move(null_masks[idx]) : rmm::device_buffer{}); } return output;