join.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 #pragma once
7 
9 #include <cudf/types.hpp>
11 #include <cudf/utilities/export.hpp>
13 
14 #include <rmm/cuda_stream_view.hpp>
15 #include <rmm/device_uvector.hpp>
16 
17 #include <cuda/std/limits>
18 
19 namespace CUDF_EXPORT cudf {
20 
37 CUDF_HOST_DEVICE constexpr size_type JoinNoMatch = cuda::std::numeric_limits<size_type>::min();
38 
48  std::unique_ptr<rmm::device_uvector<size_type>>
51 };
52 
68 };
69 
103 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
104  std::unique_ptr<rmm::device_uvector<size_type>>>
105 inner_join(cudf::table_view const& left_keys,
106  cudf::table_view const& right_keys,
107  null_equality compare_nulls = null_equality::EQUAL,
110 
144 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
145  std::unique_ptr<rmm::device_uvector<size_type>>>
146 left_join(cudf::table_view const& left_keys,
147  cudf::table_view const& right_keys,
148  null_equality compare_nulls = null_equality::EQUAL,
151 
185 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
186  std::unique_ptr<rmm::device_uvector<size_type>>>
187 full_join(cudf::table_view const& left_keys,
188  cudf::table_view const& right_keys,
189  null_equality compare_nulls = null_equality::EQUAL,
192 
218 [[deprecated]] std::unique_ptr<rmm::device_uvector<size_type>> left_semi_join(
219  cudf::table_view const& left_keys,
220  cudf::table_view const& right_keys,
221  null_equality compare_nulls = null_equality::EQUAL,
224 
253 [[deprecated]] std::unique_ptr<rmm::device_uvector<size_type>> left_anti_join(
254  cudf::table_view const& left_keys,
255  cudf::table_view const& right_keys,
256  null_equality compare_nulls = null_equality::EQUAL,
259 
283 std::unique_ptr<cudf::table> cross_join(
284  cudf::table_view const& left,
285  cudf::table_view const& right,
288  // end of group
290 
291 } // namespace CUDF_EXPORT cudf
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:189
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.
constexpr CUDF_HOST_DEVICE size_type JoinNoMatch
Sentinel value used to indicate an unmatched row index in join operations.
Definition: join.hpp:37
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.
detail::cccl_async_resource_ref< cuda::mr::resource_ref< cuda::mr::device_accessible > > device_async_resource_ref
null_equality
Enum to consider two nulls as equal or unequal.
Definition: types.hpp:140
int32_t size_type
Row index type for columns and tables.
Definition: types.hpp:84
cuDF interfaces
Definition: host_udf.hpp:26
Holds context information about matches between tables during a join operation.
Definition: join.hpp:46
std::unique_ptr< rmm::device_uvector< size_type > > _match_counts
Definition: join.hpp:49
table_view _left_table
View of the left table involved in the join operation.
Definition: join.hpp:47
Stores context information for partitioned join operations.
Definition: join.hpp:63
size_type left_start_idx
The starting row index of the current left table partition.
Definition: join.hpp:66
join_match_context left_table_context
The match context from a previous inner_join_match_context call.
Definition: join.hpp:65
size_type left_end_idx
The ending row index (exclusive) of the current left table partition.
Definition: join.hpp:67
Class definitions for (mutable)_table_view
Type declarations for libcudf.
#define CUDF_HOST_DEVICE
Indicates that the function or method is usable on host and device.
Definition: types.hpp:21