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 namespace CUDF_EXPORT cudf {
29 
45  std::unique_ptr<rmm::device_uvector<size_type>>
48 };
49 
65 };
66 
100 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
101  std::unique_ptr<rmm::device_uvector<size_type>>>
102 inner_join(cudf::table_view const& left_keys,
103  cudf::table_view const& right_keys,
104  null_equality compare_nulls = null_equality::EQUAL,
107 
142 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
143  std::unique_ptr<rmm::device_uvector<size_type>>>
144 left_join(cudf::table_view const& left_keys,
145  cudf::table_view const& right_keys,
146  null_equality compare_nulls = null_equality::EQUAL,
149 
183 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
184  std::unique_ptr<rmm::device_uvector<size_type>>>
185 full_join(cudf::table_view const& left_keys,
186  cudf::table_view const& right_keys,
187  null_equality compare_nulls = null_equality::EQUAL,
190 
214 std::unique_ptr<rmm::device_uvector<size_type>> left_semi_join(
215  cudf::table_view const& left_keys,
216  cudf::table_view const& right_keys,
217  null_equality compare_nulls = null_equality::EQUAL,
220 
247 std::unique_ptr<rmm::device_uvector<size_type>> left_anti_join(
248  cudf::table_view const& left_keys,
249  cudf::table_view const& right_keys,
250  null_equality compare_nulls = null_equality::EQUAL,
253 
277 std::unique_ptr<cudf::table> cross_join(
278  cudf::table_view const& left,
279  cudf::table_view const& right,
282  // end of group
284 
285 } // namespace CUDF_EXPORT cudf
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:200
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > left_join(cudf::table_view const &left_keys, cudf::table_view const &right_keys, null_equality compare_nulls=null_equality::EQUAL, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Returns a pair of row index vectors corresponding to a left join between the specified tables.
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > full_join(cudf::table_view const &left_keys, cudf::table_view const &right_keys, null_equality compare_nulls=null_equality::EQUAL, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Returns a pair of row index vectors corresponding to a full join between the specified tables.
std::unique_ptr< rmm::device_uvector< size_type > > left_anti_join(cudf::table_view const &left_keys, cudf::table_view const &right_keys, null_equality compare_nulls=null_equality::EQUAL, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Returns a vector of row indices corresponding to a left anti join between the specified tables.
std::unique_ptr< rmm::device_uvector< size_type > > left_semi_join(cudf::table_view const &left_keys, cudf::table_view const &right_keys, null_equality compare_nulls=null_equality::EQUAL, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Returns a vector of row indices corresponding to a left semi-join between the specified tables.
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > inner_join(cudf::table_view const &left_keys, cudf::table_view const &right_keys, null_equality compare_nulls=null_equality::EQUAL, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Returns a pair of row index vectors corresponding to an inner join between the specified tables.
std::unique_ptr< cudf::table > cross_join(cudf::table_view const &left, cudf::table_view const &right, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref())
Performs a cross join on two tables (left, right)
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.
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
int32_t size_type
Row index type for columns and tables.
Definition: types.hpp:95
cuDF interfaces
Definition: host_udf.hpp:37
Holds context information about matches between tables during a join operation.
Definition: join.hpp:43
std::unique_ptr< rmm::device_uvector< size_type > > _match_counts
Definition: join.hpp:46
table_view _left_table
View of the left table involved in the join operation.
Definition: join.hpp:44
Stores context information for partitioned join operations.
Definition: join.hpp:60
size_type left_start_idx
The starting row index of the current left table partition.
Definition: join.hpp:63
join_match_context left_table_context
The match context from a previous inner_join_match_context call.
Definition: join.hpp:62
size_type left_end_idx
The ending row index (exclusive) of the current left table partition.
Definition: join.hpp:64
Class definitions for (mutable)_table_view
Type declarations for libcudf.