diff --git a/cpp/include/cudf/detail/join/distinct_hash_join.cuh b/cpp/include/cudf/detail/join/distinct_hash_join.cuh index b6b6ea889ae0..3da903dc4158 100644 --- a/cpp/include/cudf/detail/join/distinct_hash_join.cuh +++ b/cpp/include/cudf/detail/join/distinct_hash_join.cuh @@ -49,7 +49,7 @@ struct always_not_equal { }; /** - * @brief An comparator adapter wrapping the two table comparator + * @brief A comparator adapter wrapping the two table comparator */ template struct comparator_adapter { @@ -67,6 +67,25 @@ struct comparator_adapter { Equal _d_equal; }; +/** + * @brief A comparator adapter wrapping the two table comparator + */ +template +struct primitive_comparator_adapter { + primitive_comparator_adapter(Equal const& d_equal) : _d_equal{d_equal} {} + + __device__ constexpr auto operator()( + cuco::pair const& lhs, + cuco::pair const& rhs) const noexcept + { + if (lhs.first != rhs.first) { return false; } + return _d_equal(static_cast(lhs.second), static_cast(rhs.second)); + } + + private: + Equal _d_equal; +}; + /** * @brief Distinct hash join that builds hash table in creation and probes results in subsequent * `*_join` member functions. diff --git a/cpp/include/cudf/table/experimental/row_operators.cuh b/cpp/include/cudf/table/experimental/row_operators.cuh index 7c200aa9859f..33ea7fffbe55 100644 --- a/cpp/include/cudf/table/experimental/row_operators.cuh +++ b/cpp/include/cudf/table/experimental/row_operators.cuh @@ -56,6 +56,13 @@ namespace CUDF_EXPORT cudf { +namespace row::primitive { +class row_equality_comparator; // Forward declaration + +template