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 
87 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
88  std::unique_ptr<rmm::device_uvector<size_type>>>
89 mixed_inner_join(table_view const& left_equality,
90  table_view const& right_equality,
91  table_view const& left_conditional,
92  table_view const& right_conditional,
93  ast::expression const& binary_predicate,
94  null_equality compare_nulls = null_equality::EQUAL,
95  std::optional<std::size_t> output_size = {},
98 
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  std::optional<std::size_t> output_size = {},
158 
206 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
207  std::unique_ptr<rmm::device_uvector<size_type>>>
208 mixed_full_join(table_view const& left_equality,
209  table_view const& right_equality,
210  table_view const& left_conditional,
211  table_view const& right_conditional,
212  ast::expression const& binary_predicate,
213  null_equality compare_nulls = null_equality::EQUAL,
214  std::optional<std::size_t> output_size = {},
217 
255 std::unique_ptr<rmm::device_uvector<size_type>> mixed_left_semi_join(
256  table_view const& left_equality,
257  table_view const& right_equality,
258  table_view const& left_conditional,
259  table_view const& right_conditional,
260  ast::expression const& binary_predicate,
261  null_equality compare_nulls = null_equality::EQUAL,
264 
303 std::unique_ptr<rmm::device_uvector<size_type>> mixed_left_anti_join(
304  table_view const& left_equality,
305  table_view const& right_equality,
306  table_view const& left_conditional,
307  table_view const& right_conditional,
308  ast::expression const& binary_predicate,
309  null_equality compare_nulls = null_equality::EQUAL,
312 
340 std::size_t mixed_inner_join_size(table_view const& left_equality,
341  table_view const& right_equality,
342  table_view const& left_conditional,
343  table_view const& right_conditional,
344  ast::expression const& binary_predicate,
345  null_equality compare_nulls = null_equality::EQUAL,
347 
375 std::size_t mixed_left_join_size(table_view const& left_equality,
376  table_view const& right_equality,
377  table_view const& left_conditional,
378  table_view const& right_conditional,
379  ast::expression const& binary_predicate,
380  null_equality compare_nulls = null_equality::EQUAL,
382  // end of group
384 
385 } // 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::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::size_t 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())
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, std::optional< std::size_t > output_size={}, 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_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::size_t > output_size={}, 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::size_t 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())
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_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::size_t > output_size={}, 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:49
Class definitions for (mutable)_table_view
Type declarations for libcudf.