streaming_hash_join.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 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>
12 #include <cudf/utilities/export.hpp>
14 
15 #include <rmm/device_uvector.hpp>
16 
17 #include <cuda/stream_ref>
18 
19 #include <memory>
20 #include <optional>
21 #include <span>
22 #include <utility>
23 
24 namespace CUDF_EXPORT cudf {
25 
32 namespace detail {
33 class streaming_hash_join_impl;
34 } // namespace detail
35 
51  public:
52  streaming_hash_join() = delete;
55  streaming_hash_join& operator=(streaming_hash_join const&) = delete;
56 
59 
64  streaming_hash_join& operator=(streaming_hash_join&&) noexcept;
65 
95  streaming_hash_join(cudf::table_view const& right_schema,
96  std::span<size_type const> right_key_indices,
97  size_type total_right_rows,
98  size_type max_num_batches,
100  null_equality compare_nulls,
101  double load_factor = 0.5,
102  cuda::stream_ref stream = cudf::get_default_stream(),
104 
129  void insert(cudf::table_view const& right_partition,
130  cuda::stream_ref stream = cudf::get_default_stream());
131 
149  [[nodiscard]] cudf::table_view get_partition(size_type batch_id) const;
150 
175  [[nodiscard]] std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
176  std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
177  std::unique_ptr<rmm::device_uvector<size_type>>>>
178  inner_join(cudf::table_view const& left,
179  std::optional<std::size_t> output_size = {},
180  cuda::stream_ref stream = cudf::get_default_stream(),
182 
183  private:
184  std::unique_ptr<cudf::detail::streaming_hash_join_impl> _impl;
185 };
186  // end of group
188 
189 } // namespace CUDF_EXPORT cudf
Non-owning references to the memory resources used by a cuDF operation.
Streaming hash join that accepts the right (build) side incrementally via insert().
streaming_hash_join(streaming_hash_join &&) noexcept
Move constructor.
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:206
APIs for querying the default CUDA stream and per-thread default stream status.
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, cuda::stream_ref 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.
nullable_join
Specifies whether join-key columns may contain nulls.
Definition: join.hpp:68
cuda::stream_ref 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.
device_async_resource_ref get_current_device_resource_ref()
null_equality
Enum to consider two nulls as equal or unequal.
Definition: types.hpp:132
int32_t size_type
Row index type for columns and tables.
Definition: types.hpp:76
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:27
bool has_nulls(table_view const &view)
Returns True if the table has nulls in any of its columns.
Class definitions for (mutable)_table_view
Type declarations for libcudf.