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 
48 using output_size_data_type = std::optional<std::pair<std::size_t, device_span<size_type const>>>;
49 
97 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
98  std::unique_ptr<rmm::device_uvector<size_type>>>
99 mixed_inner_join(table_view const& left_equality,
100  table_view const& right_equality,
101  table_view const& left_conditional,
102  table_view const& right_conditional,
103  ast::expression const& binary_predicate,
104  null_equality compare_nulls = null_equality::EQUAL,
105  output_size_data_type output_size_data = {},
108 
158 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
159  std::unique_ptr<rmm::device_uvector<size_type>>>
160 mixed_left_join(table_view const& left_equality,
161  table_view const& right_equality,
162  table_view const& left_conditional,
163  table_view const& right_conditional,
164  ast::expression const& binary_predicate,
165  null_equality compare_nulls = null_equality::EQUAL,
166  output_size_data_type output_size_data = {},
169 
219 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
220  std::unique_ptr<rmm::device_uvector<size_type>>>
221 mixed_full_join(table_view const& left_equality,
222  table_view const& right_equality,
223  table_view const& left_conditional,
224  table_view const& right_conditional,
225  ast::expression const& binary_predicate,
226  null_equality compare_nulls = null_equality::EQUAL,
227  output_size_data_type output_size_data = {},
230 
268 std::unique_ptr<rmm::device_uvector<size_type>> mixed_left_semi_join(
269  table_view const& left_equality,
270  table_view const& right_equality,
271  table_view const& left_conditional,
272  table_view const& right_conditional,
273  ast::expression const& binary_predicate,
274  null_equality compare_nulls = null_equality::EQUAL,
277 
316 std::unique_ptr<rmm::device_uvector<size_type>> mixed_left_anti_join(
317  table_view const& left_equality,
318  table_view const& right_equality,
319  table_view const& left_conditional,
320  table_view const& right_conditional,
321  ast::expression const& binary_predicate,
322  null_equality compare_nulls = null_equality::EQUAL,
325 
358 std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type>>> mixed_inner_join_size(
359  table_view const& left_equality,
360  table_view const& right_equality,
361  table_view const& left_conditional,
362  table_view const& right_conditional,
363  ast::expression const& binary_predicate,
364  null_equality compare_nulls = null_equality::EQUAL,
367 
400 std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type>>> mixed_left_join_size(
401  table_view const& left_equality,
402  table_view const& right_equality,
403  table_view const& left_conditional,
404  table_view const& right_conditional,
405  ast::expression const& binary_predicate,
406  null_equality compare_nulls = null_equality::EQUAL,
409  // end of group
411 
412 } // namespace CUDF_EXPORT cudf
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:200
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:48
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::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:72
Class definitions for (mutable)_table_view
Type declarations for libcudf.