sort_merge_join.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 
6 #pragma once
7 
8 #include <cudf/join/join.hpp>
10 #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 <memory>
18 
19 namespace CUDF_EXPORT cudf {
20 
27 // Forward declaration
28 namespace detail {
29 class sort_merge_join;
30 }
31 
41  public:
42  sort_merge_join() = delete;
43  ~sort_merge_join();
44  sort_merge_join(sort_merge_join const&) = delete;
45  sort_merge_join(sort_merge_join&&) = delete;
46  sort_merge_join& operator=(sort_merge_join const&) = delete;
47  sort_merge_join& operator=(sort_merge_join&&) = delete;
48 
63  sorted is_right_sorted,
64  null_equality compare_nulls = null_equality::EQUAL,
66 
84  std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
85  std::unique_ptr<rmm::device_uvector<size_type>>>
86  inner_join(table_view const& left,
87  sorted is_left_sorted,
90 
107  std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
108  std::unique_ptr<rmm::device_uvector<size_type>>>
109  left_join(table_view const& left,
110  sorted is_left_sorted,
113 
139  std::unique_ptr<join_match_context> inner_join_match_context(
140  table_view const& left,
141  sorted is_left_sorted,
144 
197  std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
198  std::unique_ptr<rmm::device_uvector<size_type>>>
200  cudf::join_partition_context const& context,
203 
204  private:
205  using impl_type = cudf::detail::sort_merge_join;
206  std::unique_ptr<impl_type const> _impl;
207 };
208  // end of group
210 } // namespace CUDF_EXPORT cudf
Class that implements sort-merge algorithm for table joins.
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > inner_join(table_view const &left, sorted is_left_sorted, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) const
Returns the row indices that can be used to construct the result of performing an inner join between ...
std::unique_ptr< join_match_context > inner_join_match_context(table_view const &left, sorted is_left_sorted, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) const
Returns context information about matches between the left and right tables.
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > partitioned_inner_join(cudf::join_partition_context const &context, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) const
Performs an inner join between a partition of the left table and the right table.
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > left_join(table_view const &left, sorted is_left_sorted, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::device_async_resource_ref mr=cudf::get_current_device_resource_ref()) const
Returns the row indices that can be used to construct the result of performing a left join between th...
sort_merge_join(table_view const &right, sorted is_right_sorted, null_equality compare_nulls=null_equality::EQUAL, rmm::cuda_stream_view stream=cudf::get_default_stream())
Construct a sort-merge join object that pre-processes the right table on creation,...
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:189
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
sorted
Indicates whether a collection of values is known to be sorted.
Definition: types.hpp:156
cuDF interfaces
Definition: host_udf.hpp:26
Stores context information for partitioned join operations.
Definition: join.hpp:95
Class definitions for (mutable)_table_view
Type declarations for libcudf.