mixed_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 
10 #include <cudf/types.hpp>
12 #include <cudf/utilities/export.hpp>
14 #include <cudf/utilities/span.hpp>
15 
16 #include <rmm/device_uvector.hpp>
17 
18 #include <cuda/stream>
19 
20 #include <optional>
21 #include <utility>
22 
28 namespace CUDF_EXPORT cudf {
29 
42 using output_size_data_type = std::optional<std::pair<std::size_t, device_span<size_type const>>>;
43 
91 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
92  std::unique_ptr<rmm::device_uvector<size_type>>>
93 mixed_inner_join(table_view const& left_equality,
94  table_view const& right_equality,
95  table_view const& left_conditional,
96  table_view const& right_conditional,
97  ast::expression const& binary_predicate,
98  null_equality compare_nulls = null_equality::EQUAL,
99  output_size_data_type output_size_data = {},
100  cuda::stream_ref stream = cudf::get_default_stream(),
102 
152 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
153  std::unique_ptr<rmm::device_uvector<size_type>>>
154 mixed_left_join(table_view const& left_equality,
155  table_view const& right_equality,
156  table_view const& left_conditional,
157  table_view const& right_conditional,
158  ast::expression const& binary_predicate,
159  null_equality compare_nulls = null_equality::EQUAL,
160  output_size_data_type output_size_data = {},
161  cuda::stream_ref stream = cudf::get_default_stream(),
163 
213 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
214  std::unique_ptr<rmm::device_uvector<size_type>>>
215 mixed_full_join(table_view const& left_equality,
216  table_view const& right_equality,
217  table_view const& left_conditional,
218  table_view const& right_conditional,
219  ast::expression const& binary_predicate,
220  null_equality compare_nulls = null_equality::EQUAL,
221  output_size_data_type output_size_data = {},
222  cuda::stream_ref stream = cudf::get_default_stream(),
224 
262 std::unique_ptr<rmm::device_uvector<size_type>> mixed_left_semi_join(
263  table_view const& left_equality,
264  table_view const& right_equality,
265  table_view const& left_conditional,
266  table_view const& right_conditional,
267  ast::expression const& binary_predicate,
268  null_equality compare_nulls = null_equality::EQUAL,
269  cuda::stream_ref stream = cudf::get_default_stream(),
271 
310 std::unique_ptr<rmm::device_uvector<size_type>> mixed_left_anti_join(
311  table_view const& left_equality,
312  table_view const& right_equality,
313  table_view const& left_conditional,
314  table_view const& right_conditional,
315  ast::expression const& binary_predicate,
316  null_equality compare_nulls = null_equality::EQUAL,
317  cuda::stream_ref stream = cudf::get_default_stream(),
319 
352 std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type>>> mixed_inner_join_size(
353  table_view const& left_equality,
354  table_view const& right_equality,
355  table_view const& left_conditional,
356  table_view const& right_conditional,
357  ast::expression const& binary_predicate,
358  null_equality compare_nulls = null_equality::EQUAL,
359  cuda::stream_ref stream = cudf::get_default_stream(),
361 
394 std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type>>> mixed_left_join_size(
395  table_view const& left_equality,
396  table_view const& right_equality,
397  table_view const& left_conditional,
398  table_view const& right_conditional,
399  ast::expression const& binary_predicate,
400  null_equality compare_nulls = null_equality::EQUAL,
401  cuda::stream_ref stream = cudf::get_default_stream(),
403  // end of group
405 
406 } // namespace CUDF_EXPORT cudf
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.
Class definitions for building and evaluating abstract syntax tree expressions.
std::unique_ptr< rmm::device_uvector< size_type > > mixed_left_semi_join(table_view const &left_equality, table_view const &right_equality, table_view const &left_conditional, table_view const &right_conditional, ast::expression const &binary_predicate, 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 an index vector corresponding to all rows in the left tables where the columns of the equalit...
std::pair< std::size_t, std::unique_ptr< rmm::device_uvector< size_type > > > mixed_inner_join_size(table_view const &left_equality, table_view const &right_equality, table_view const &left_conditional, table_view const &right_conditional, ast::expression const &binary_predicate, 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 the exact number of matches (rows) when performing a mixed inner join between the specified t...
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > mixed_full_join(table_view const &left_equality, table_view const &right_equality, table_view const &left_conditional, table_view const &right_conditional, ast::expression const &binary_predicate, null_equality compare_nulls=null_equality::EQUAL, output_size_data_type output_size_data={}, 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 all pairs of rows between the specified tables w...
std::optional< std::pair< std::size_t, device_span< size_type const > >> output_size_data_type
Type alias for output size data used in mixed joins.
Definition: mixed_join.hpp:42
std::pair< std::size_t, std::unique_ptr< rmm::device_uvector< size_type > > > mixed_left_join_size(table_view const &left_equality, table_view const &right_equality, table_view const &left_conditional, table_view const &right_conditional, ast::expression const &binary_predicate, 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 the exact number of matches (rows) when performing a mixed left join between the specified ta...
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > mixed_inner_join(table_view const &left_equality, table_view const &right_equality, table_view const &left_conditional, table_view const &right_conditional, ast::expression const &binary_predicate, null_equality compare_nulls=null_equality::EQUAL, output_size_data_type output_size_data={}, 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 all pairs of rows between the specified tables w...
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > mixed_left_join(table_view const &left_equality, table_view const &right_equality, table_view const &left_conditional, table_view const &right_conditional, ast::expression const &binary_predicate, null_equality compare_nulls=null_equality::EQUAL, output_size_data_type output_size_data={}, 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 all pairs of rows between the specified tables w...
std::unique_ptr< rmm::device_uvector< size_type > > mixed_left_anti_join(table_view const &left_equality, table_view const &right_equality, table_view const &left_conditional, table_view const &right_conditional, ast::expression const &binary_predicate, 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 an index vector corresponding to all rows in the left tables for which there is no row in the...
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.
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:132
APIs for getting and setting the current device memory resource.
cuDF interfaces
Definition: host_udf.hpp:27
APIs for spans.
A generic expression that can be evaluated to return a value.
Definition: expressions.hpp:72
Class definitions for (mutable)_table_view
Type declarations for libcudf.