mixed_join.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2025, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
19 #include <cudf/ast/expressions.hpp>
21 #include <cudf/types.hpp>
23 #include <cudf/utilities/export.hpp>
25 #include <cudf/utilities/span.hpp>
26 
27 #include <rmm/cuda_stream_view.hpp>
28 #include <rmm/device_uvector.hpp>
29 
30 #include <optional>
31 #include <utility>
32 
33 namespace CUDF_EXPORT cudf {
34 
88 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
89  std::unique_ptr<rmm::device_uvector<size_type>>>
91  table_view const& left_equality,
92  table_view const& right_equality,
93  table_view const& left_conditional,
94  table_view const& right_conditional,
95  ast::expression const& binary_predicate,
96  null_equality compare_nulls = null_equality::EQUAL,
97  std::optional<std::pair<std::size_t, device_span<size_type const>>> output_size_data = {},
100 
150 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
151  std::unique_ptr<rmm::device_uvector<size_type>>>
153  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  std::optional<std::pair<std::size_t, device_span<size_type const>>> output_size_data = {},
162 
212 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
213  std::unique_ptr<rmm::device_uvector<size_type>>>
215  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  std::optional<std::pair<std::size_t, device_span<size_type const>>> output_size_data = {},
224 
264 std::unique_ptr<rmm::device_uvector<size_type>> mixed_left_semi_join(
265  table_view const& left_equality,
266  table_view const& right_equality,
267  table_view const& left_conditional,
268  table_view const& right_conditional,
269  ast::expression const& binary_predicate,
270  null_equality compare_nulls = null_equality::EQUAL,
273 
314 std::unique_ptr<rmm::device_uvector<size_type>> mixed_left_anti_join(
315  table_view const& left_equality,
316  table_view const& right_equality,
317  table_view const& left_conditional,
318  table_view const& right_conditional,
319  ast::expression const& binary_predicate,
320  null_equality compare_nulls = null_equality::EQUAL,
323 
356 std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type>>> mixed_inner_join_size(
357  table_view const& left_equality,
358  table_view const& right_equality,
359  table_view const& left_conditional,
360  table_view const& right_conditional,
361  ast::expression const& binary_predicate,
362  null_equality compare_nulls = null_equality::EQUAL,
365 
398 std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type>>> mixed_left_join_size(
399  table_view const& left_equality,
400  table_view const& right_equality,
401  table_view const& left_conditional,
402  table_view const& right_conditional,
403  ast::expression const& binary_predicate,
404  null_equality compare_nulls = null_equality::EQUAL,
407  // end of group
409 
410 } // namespace CUDF_EXPORT cudf
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:200
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::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, std::optional< std::pair< std::size_t, device_span< size_type const >>> 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::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, std::optional< std::pair< std::size_t, device_span< size_type const >>> 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::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, std::optional< std::pair< std::size_t, device_span< size_type const >>> 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...
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::async_resource_ref< cuda::mr::device_accessible > device_async_resource_ref
null_equality
Enum to consider two nulls as equal or unequal.
Definition: types.hpp:151
cuDF interfaces
Definition: host_udf.hpp:37
APIs for spans.
A generic expression that can be evaluated to return a value.
Definition: expressions.hpp:48
Device version of C++20 std::span with reduced feature set.
Definition: span.hpp:355
Class definitions for (mutable)_table_view
Type declarations for libcudf.