Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace unnecessary uses of UNKNOWN_NULL_COUNT #13102

Merged
merged 14 commits into from
Apr 10, 2023
4 changes: 2 additions & 2 deletions cpp/src/binaryop/compiled/binary_ops.cu
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ scalar_as_column_view::return_type scalar_as_column_view::operator()<cudf::strin
auto col_v = column_view(s.type(),
1,
nullptr,
(bitmask_type const*)s.validity_data(),
cudf::UNKNOWN_NULL_COUNT,
reinterpret_cast<bitmask_type const*>(s.validity_data()),
static_cast<size_type>(!s.is_valid(stream)),
0,
{offsets_column->view(), chars_column_v});
return std::pair{col_v, std::move(offsets_column)};
Expand Down
10 changes: 3 additions & 7 deletions cpp/src/copying/pack.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022, NVIDIA CORPORATION.
* Copyright (c) 2021-2023, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -159,12 +159,8 @@ packed_columns::metadata pack_metadata(ColumnIter begin,

// first metadata entry is a stub indicating how many total (top level) columns
// there are
metadata.emplace_back(data_type{type_id::EMPTY},
static_cast<size_type>(std::distance(begin, end)),
UNKNOWN_NULL_COUNT,
-1,
-1,
0);
metadata.emplace_back(
data_type{type_id::EMPTY}, static_cast<size_type>(std::distance(begin, end)), 0, -1, -1, 0);

std::for_each(begin, end, [&metadata, &contiguous_buffer, &buffer_size](column_view const& col) {
build_column_metadata(metadata, col, contiguous_buffer, buffer_size);
Expand Down
8 changes: 4 additions & 4 deletions cpp/src/interop/from_arrow.cu
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ std::unique_ptr<column> dispatch_to_cudf_column::operator()<cudf::string_view>(
auto out_col = make_strings_column(num_rows,
std::move(offsets_column),
std::move(chars_column),
UNKNOWN_NULL_COUNT,
array.null_count(),
std::move(*get_mask_buffer(array, stream, mr)));

return num_rows == array.length()
Expand Down Expand Up @@ -324,7 +324,7 @@ std::unique_ptr<column> dispatch_to_cudf_column::operator()<cudf::dictionary32>(
return make_dictionary_column(std::move(keys_column),
std::move(indices_column),
std::move(*(column_contents.null_mask)),
UNKNOWN_NULL_COUNT);
array.null_count());
}

template <>
Expand Down Expand Up @@ -357,7 +357,7 @@ std::unique_ptr<column> dispatch_to_cudf_column::operator()<cudf::struct_view>(
}

return make_structs_column(
array.length(), move(child_columns), UNKNOWN_NULL_COUNT, std::move(out_mask), stream, mr);
array.length(), move(child_columns), array.null_count(), std::move(out_mask), stream, mr);
}

template <>
Expand All @@ -381,7 +381,7 @@ std::unique_ptr<column> dispatch_to_cudf_column::operator()<cudf::list_view>(
auto out_col = make_lists_column(num_rows,
std::move(offsets_column),
std::move(child_column),
UNKNOWN_NULL_COUNT,
array.null_count(),
std::move(*get_mask_buffer(array, stream, mr)),
stream,
mr);
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/lists/copying/concatenate.cu
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* limitations under the License.
*/

#include <algorithm>
#include <cudf/column/column.hpp>
#include <cudf/column/column_device_view.cuh>
#include <cudf/column/column_factories.hpp>
Expand All @@ -29,6 +28,7 @@

#include <thrust/transform.h>

#include <algorithm>
#include <memory>

namespace cudf {
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/lists/dremel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ dremel_data get_encoding(column_view h_col,
col.size(),
col.head(),
col.null_mask(),
UNKNOWN_NULL_COUNT,
col.null_count(),
col.offset(),
std::move(children));
};
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/table/row_operators.cu
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ auto decompose_structs(table_view table,
prev_col.size(),
nullptr,
prev_col.null_mask(),
UNKNOWN_NULL_COUNT,
prev_col.null_count(),
prev_col.offset(),
std::move(children));
}
Expand All @@ -220,7 +220,7 @@ auto decompose_structs(table_view table,
parent->size(),
nullptr, // list has no data of its own
nullptr, // If we're going through this then nullmask is already in another branch
UNKNOWN_NULL_COUNT,
0,
parent->offset(),
{*parent->children[lists_column_view::offsets_column_index], temp_col});
} else if (parent->type().id() == type_id::STRUCT) {
Expand All @@ -229,7 +229,7 @@ auto decompose_structs(table_view table,
parent->size(),
temp_col.head(),
temp_col.null_mask(),
UNKNOWN_NULL_COUNT,
temp_col.null_count(),
parent->offset(),
{temp_col.child_begin(), temp_col.child_end()});
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/transform/transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ std::unique_ptr<column> transform(column_view const& input,
CUDF_EXPECTS(is_fixed_width(input.type()), "Unexpected non-fixed-width type.");

std::unique_ptr<column> output = make_fixed_width_column(
output_type, input.size(), copy_bitmask(input), cudf::UNKNOWN_NULL_COUNT, stream, mr);
output_type, input.size(), copy_bitmask(input), input.null_count(), stream, mr);

if (input.is_empty()) { return output; }

Expand Down