mixed_join.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2025, NVIDIA CORPORATION.
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 
22 namespace CUDF_EXPORT cudf {
23 
37 using output_size_data_type = std::optional<std::pair<std::size_t, device_span<size_type const>>>;
38 
86 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
87  std::unique_ptr<rmm::device_uvector<size_type>>>
88 mixed_inner_join(table_view const& left_equality,
89  table_view const& right_equality,
90  table_view const& left_conditional,
91  table_view const& right_conditional,
92  ast::expression const& binary_predicate,
93  null_equality compare_nulls = null_equality::EQUAL,
94  output_size_data_type output_size_data = {},
97 
147 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
148  std::unique_ptr<rmm::device_uvector<size_type>>>
149 mixed_left_join(table_view const& left_equality,
150  table_view const& right_equality,
151  table_view const& left_conditional,
152  table_view const& right_conditional,
153  ast::expression const& binary_predicate,
154  null_equality compare_nulls = null_equality::EQUAL,
155  output_size_data_type output_size_data = {},
158 
208 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
209  std::unique_ptr<rmm::device_uvector<size_type>>>
210 mixed_full_join(table_view const& left_equality,
211  table_view const& right_equality,
212  table_view const& left_conditional,
213  table_view const& right_conditional,
214  ast::expression const& binary_predicate,
215  null_equality compare_nulls = null_equality::EQUAL,
216  output_size_data_type output_size_data = {},
219 
257 std::unique_ptr<rmm::device_uvector<size_type>> mixed_left_semi_join(
258  table_view const& left_equality,
259  table_view const& right_equality,
260  table_view const& left_conditional,
261  table_view const& right_conditional,
262  ast::expression const& binary_predicate,
263  null_equality compare_nulls = null_equality::EQUAL,
266 
305 std::unique_ptr<rmm::device_uvector<size_type>> mixed_left_anti_join(
306  table_view const& left_equality,
307  table_view const& right_equality,
308  table_view const& left_conditional,
309  table_view const& right_conditional,
310  ast::expression const& binary_predicate,
311  null_equality compare_nulls = null_equality::EQUAL,
314 
347 std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type>>> mixed_inner_join_size(
348  table_view const& left_equality,
349  table_view const& right_equality,
350  table_view const& left_conditional,
351  table_view const& right_conditional,
352  ast::expression const& binary_predicate,
353  null_equality compare_nulls = null_equality::EQUAL,
356 
389 std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type>>> mixed_left_join_size(
390  table_view const& left_equality,
391  table_view const& right_equality,
392  table_view const& left_conditional,
393  table_view const& right_conditional,
394  ast::expression const& binary_predicate,
395  null_equality compare_nulls = null_equality::EQUAL,
398  // end of group
400 
401 } // namespace CUDF_EXPORT cudf
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:189
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:37
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
cuDF interfaces
Definition: host_udf.hpp:26
APIs for spans.
A generic expression that can be evaluated to return a value.
Definition: expressions.hpp:61
Class definitions for (mutable)_table_view
Type declarations for libcudf.