filtered_join.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2025, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
20 #include <cudf/types.hpp>
22 #include <cudf/utilities/export.hpp>
24 
25 #include <rmm/cuda_stream_view.hpp>
26 #include <rmm/device_uvector.hpp>
27 
28 #include <utility>
29 
30 namespace CUDF_EXPORT cudf {
31 
38 namespace detail {
42 class filtered_join;
43 } // namespace detail
44 
49 enum class set_as_build_table { LEFT, RIGHT };
50 
66  public:
67  filtered_join() = delete;
68  ~filtered_join();
69  filtered_join(filtered_join const&) = delete;
70  filtered_join(filtered_join&&) = delete;
71  filtered_join& operator=(filtered_join const&) = delete;
72  filtered_join& operator=(filtered_join&&) = delete;
73 
86  cudf::null_equality compare_nulls = null_equality::EQUAL,
87  set_as_build_table reuse_tbl = set_as_build_table::RIGHT,
89 
105  null_equality compare_nulls = null_equality::EQUAL,
106  set_as_build_table reuse_tbl = set_as_build_table::RIGHT,
107  double load_factor = 0.5,
109 
132  [[nodiscard]] std::unique_ptr<rmm::device_uvector<size_type>> semi_join(
133  cudf::table_view const& probe,
136 
159  [[nodiscard]] std::unique_ptr<rmm::device_uvector<size_type>> anti_join(
160  cudf::table_view const& probe,
163 
164  private:
165  set_as_build_table _reuse_tbl;
166  std::unique_ptr<cudf::detail::filtered_join> _impl;
167 };
168  // end of group
170 
171 } // namespace CUDF_EXPORT cudf
Filtered hash join that builds hash table on creation and probes results in subsequent *_join member ...
filtered_join(cudf::table_view const &build, cudf::null_equality compare_nulls=null_equality::EQUAL, set_as_build_table reuse_tbl=set_as_build_table::RIGHT, rmm::cuda_stream_view stream=cudf::get_default_stream())
Constructs a filtered hash join object for subsequent probe calls.
std::unique_ptr< rmm::device_uvector< size_type > > semi_join(cudf::table_view const &probe, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) const
Returns a vector of row indices corresponding to a semi-join between the specified tables.
filtered_join(cudf::table_view const &build, null_equality compare_nulls=null_equality::EQUAL, set_as_build_table reuse_tbl=set_as_build_table::RIGHT, double load_factor=0.5, rmm::cuda_stream_view stream=cudf::get_default_stream())
Constructs a filtered hash join object for subsequent probe calls.
std::unique_ptr< rmm::device_uvector< size_type > > anti_join(cudf::table_view const &probe, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) const
Returns a vector of row indices corresponding to a anti-join between the specified tables.
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:200
set_as_build_table
Specifies which table to use as the build table in a hash join operation.
rmm::cuda_stream_view const get_default_stream()
Get the current default stream.
rmm::device_async_resource_ref get_current_device_resource_ref()
Get the current device memory resource reference.
detail::cccl_async_resource_ref< cuda::mr::async_resource_ref< cuda::mr::device_accessible > > device_async_resource_ref
null_equality
Enum to consider two nulls as equal or unequal.
Definition: types.hpp:151
cuDF interfaces
Definition: host_udf.hpp:37
Class definitions for (mutable)_table_view
Type declarations for libcudf.