sort_merge_join.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
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 
24 namespace CUDF_EXPORT cudf {
25 
31 // Forward declaration
32 namespace detail {
33 class sort_merge_join;
34 }
35 
45  public:
46  sort_merge_join() = delete;
47  ~sort_merge_join();
48  sort_merge_join(sort_merge_join const&) = delete;
49  sort_merge_join(sort_merge_join&&) = delete;
50  sort_merge_join& operator=(sort_merge_join const&) = delete;
51  sort_merge_join& operator=(sort_merge_join&&) = delete;
52 
67  sorted is_right_sorted,
68  null_equality compare_nulls = null_equality::EQUAL,
70 
88  std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
89  std::unique_ptr<rmm::device_uvector<size_type>>>
90  inner_join(table_view const& left,
91  sorted is_left_sorted,
94 
111  std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
112  std::unique_ptr<rmm::device_uvector<size_type>>>
113  left_join(table_view const& left,
114  sorted is_left_sorted,
117 
143  std::unique_ptr<join_match_context> inner_join_match_context(
144  table_view const& left,
145  sorted is_left_sorted,
148 
201  std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
202  std::unique_ptr<rmm::device_uvector<size_type>>>
204  cudf::join_partition_context const& context,
207 
208  private:
209  using impl_type = cudf::detail::sort_merge_join;
210  std::unique_ptr<impl_type const> _impl;
211 };
212  // end of group
214 } // 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:206
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::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
Common types and utilities shared by cuDF's join APIs.
APIs for getting and setting the current device memory resource.
cuDF interfaces
Definition: host_udf.hpp:26
Stores context information for partitioned join operations.
Definition: join.hpp:116
Class definitions for (mutable)_table_view
Type declarations for libcudf.