Skip to content

Commit b13ada2

Browse files
authored
Fix approx distinct count nan handling (rapidsai#21806)
This PR fixes a bug uncovered by the cuco version bump. The cuco update is required for Spark 26.04, as it enables full support for deletion vectors. Authors: - Yunsong Wang (https://github.com/PointKernel) Approvers: - Nghia Truong (https://github.com/ttnghia) - Bradley Dice (https://github.com/bdice) URL: rapidsai#21806
1 parent 0f291eb commit b13ada2

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

cpp/src/reductions/approx_distinct_count.cu

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <rmm/device_uvector.hpp>
2020

2121
#include <cuda/functional>
22+
#include <cuda/std/type_traits>
2223
#include <thrust/iterator/counting_iterator.h>
2324

2425
#include <cmath>
@@ -106,12 +107,14 @@ struct row_is_valid {
106107
*/
107108
template <typename Hasher>
108109
struct nan_to_null_hasher {
110+
using result_type = cuda::std::invoke_result_t<Hasher, cudf::size_type>;
111+
109112
Hasher base_hasher;
110113
table_device_view d_table;
111114

112-
__device__ hash_value_type operator()(cudf::size_type row_idx) const noexcept
115+
__device__ result_type operator()(cudf::size_type row_idx) const noexcept
113116
{
114-
constexpr auto null_hash = cuda::std::numeric_limits<hash_value_type>::max();
117+
constexpr auto null_hash = cuda::std::numeric_limits<result_type>::max();
115118

116119
for (cudf::size_type col_idx = 0; col_idx < d_table.num_columns(); ++col_idx) {
117120
auto const& col = d_table.column(col_idx);

0 commit comments

Comments
 (0)