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/cuda_stream_view.hpp>
17 #include <rmm/device_uvector.hpp>
18 
19 #include <optional>
20 #include <utility>
21 
27 namespace CUDF_EXPORT cudf {
28 
41 using output_size_data_type = std::optional<std::pair<std::size_t, device_span<size_type const>>>;
42 
90 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
91  std::unique_ptr<rmm::device_uvector<size_type>>>
92 mixed_inner_join(table_view const& left_equality,
93  table_view const& right_equality,
94  table_view const& left_conditional,
95  table_view const& right_conditional,
96  ast::expression const& binary_predicate,
97  null_equality compare_nulls = null_equality::EQUAL,
98  output_size_data_type output_size_data = {},
101 
151 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
152  std::unique_ptr<rmm::device_uvector<size_type>>>
153 mixed_left_join(table_view const& left_equality,
154  table_view const& right_equality,
155  table_view const& left_conditional,
156  table_view const& right_conditional,
157  ast::expression const& binary_predicate,
158  null_equality compare_nulls = null_equality::EQUAL,
159  output_size_data_type output_size_data = {},
162 
212 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
213  std::unique_ptr<rmm::device_uvector<size_type>>>
214 mixed_full_join(table_view const& left_equality,
215  table_view const& right_equality,
216  table_view const& left_conditional,
217  table_view const& right_conditional,
218  ast::expression const& binary_predicate,
219  null_equality compare_nulls = null_equality::EQUAL,
220  output_size_data_type output_size_data = {},
223 
261 std::unique_ptr<rmm::device_uvector<size_type>> mixed_left_semi_join(
262  table_view const& left_equality,
263  table_view const& right_equality,
264  table_view const& left_conditional,
265  table_view const& right_conditional,
266  ast::expression const& binary_predicate,
267  null_equality compare_nulls = null_equality::EQUAL,
270 
309 std::unique_ptr<rmm::device_uvector<size_type>> mixed_left_anti_join(
310  table_view const& left_equality,
311  table_view const& right_equality,
312  table_view const& left_conditional,
313  table_view const& right_conditional,
314  ast::expression const& binary_predicate,
315  null_equality compare_nulls = null_equality::EQUAL,
318 
351 std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type>>> mixed_inner_join_size(
352  table_view const& left_equality,
353  table_view const& right_equality,
354  table_view const& left_conditional,
355  table_view const& right_conditional,
356  ast::expression const& binary_predicate,
357  null_equality compare_nulls = null_equality::EQUAL,
360 
393 std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type>>> mixed_left_join_size(
394  table_view const& left_equality,
395  table_view const& right_equality,
396  table_view const& left_conditional,
397  table_view const& right_conditional,
398  ast::expression const& binary_predicate,
399  null_equality compare_nulls = null_equality::EQUAL,
402  // end of group
404 
405 } // 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::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={}, 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 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, rmm::cuda_stream_view 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...
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={}, 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 all pairs of rows between the specified tables w...
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, rmm::cuda_stream_view 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::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, rmm::cuda_stream_view 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::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={}, 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 all pairs of rows between the specified tables w...
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, rmm::cuda_stream_view 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::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:41
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
APIs for getting and setting the current device memory resource.
cuDF interfaces
Definition: host_udf.hpp:26
APIs for spans.
A generic expression that can be evaluated to return a value.
Definition: expressions.hpp:69
Class definitions for (mutable)_table_view
Type declarations for libcudf.