libcudf  24.04.00
join.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019-2024, 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>
20 #include <cudf/hashing.hpp>
22 #include <cudf/types.hpp>
24 #include <cudf/utilities/span.hpp>
25 
26 #include <rmm/cuda_stream_view.hpp>
27 #include <rmm/device_uvector.hpp>
28 #include <rmm/mr/device/per_device_resource.hpp>
29 
30 #include <optional>
31 #include <utility>
32 #include <vector>
33 
34 namespace cudf {
35 
41 enum class has_nested : bool { YES, NO };
42 
43 // forward declaration
44 namespace hashing::detail {
45 template <typename T>
47 } // namespace hashing::detail
48 namespace detail {
49 template <typename T>
50 class hash_join;
51 
52 template <cudf::has_nested HasNested>
54 } // namespace detail
55 
94 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
95  std::unique_ptr<rmm::device_uvector<size_type>>>
96 inner_join(cudf::table_view const& left_keys,
97  cudf::table_view const& right_keys,
98  null_equality compare_nulls = null_equality::EQUAL,
99  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
100 
134 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
135  std::unique_ptr<rmm::device_uvector<size_type>>>
136 left_join(cudf::table_view const& left_keys,
137  cudf::table_view const& right_keys,
138  null_equality compare_nulls = null_equality::EQUAL,
139  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
140 
173 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
174  std::unique_ptr<rmm::device_uvector<size_type>>>
175 full_join(cudf::table_view const& left_keys,
176  cudf::table_view const& right_keys,
177  null_equality compare_nulls = null_equality::EQUAL,
178  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
179 
202 std::unique_ptr<rmm::device_uvector<size_type>> left_semi_join(
203  cudf::table_view const& left_keys,
204  cudf::table_view const& right_keys,
205  null_equality compare_nulls = null_equality::EQUAL,
206  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
207 
233 std::unique_ptr<rmm::device_uvector<size_type>> left_anti_join(
234  cudf::table_view const& left_keys,
235  cudf::table_view const& right_keys,
236  null_equality compare_nulls = null_equality::EQUAL,
237  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
238 
261 std::unique_ptr<cudf::table> cross_join(
262  cudf::table_view const& left,
263  cudf::table_view const& right,
264  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
265 
274 enum class nullable_join : bool { YES, NO };
275 
283 class hash_join {
284  public:
287 
288  hash_join() = delete;
289  ~hash_join();
290  hash_join(hash_join const&) = delete;
291  hash_join(hash_join&&) = delete;
292  hash_join& operator=(hash_join const&) = delete;
293  hash_join& operator=(hash_join&&) = delete;
294 
306  null_equality compare_nulls,
307  rmm::cuda_stream_view stream = cudf::get_default_stream());
308 
317  null_equality compare_nulls,
318  rmm::cuda_stream_view stream = cudf::get_default_stream());
319 
338  std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
339  std::unique_ptr<rmm::device_uvector<size_type>>>
341  std::optional<std::size_t> output_size = {},
342  rmm::cuda_stream_view stream = cudf::get_default_stream(),
343  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) const;
344 
363  std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
364  std::unique_ptr<rmm::device_uvector<size_type>>>
366  std::optional<std::size_t> output_size = {},
367  rmm::cuda_stream_view stream = cudf::get_default_stream(),
368  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) const;
369 
388  std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
389  std::unique_ptr<rmm::device_uvector<size_type>>>
391  std::optional<std::size_t> output_size = {},
392  rmm::cuda_stream_view stream = cudf::get_default_stream(),
393  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) const;
394 
408  [[nodiscard]] std::size_t inner_join_size(
409  cudf::table_view const& probe, rmm::cuda_stream_view stream = cudf::get_default_stream()) const;
410 
424  [[nodiscard]] std::size_t left_join_size(
425  cudf::table_view const& probe, rmm::cuda_stream_view stream = cudf::get_default_stream()) const;
426 
442  std::size_t full_join_size(
443  cudf::table_view const& probe,
444  rmm::cuda_stream_view stream = cudf::get_default_stream(),
445  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) const;
446 
447  private:
448  const std::unique_ptr<impl_type const> _impl;
449 };
450 
460 // TODO: `HasNested` to be removed via dispatching
461 template <cudf::has_nested HasNested>
463  public:
464  distinct_hash_join() = delete;
466  distinct_hash_join(distinct_hash_join const&) = delete;
468  distinct_hash_join& operator=(distinct_hash_join const&) = delete;
469  distinct_hash_join& operator=(distinct_hash_join&&) = delete;
470 
482  cudf::table_view const& probe,
483  nullable_join has_nulls = nullable_join::YES,
484  null_equality compare_nulls = null_equality::EQUAL,
485  rmm::cuda_stream_view stream = cudf::get_default_stream());
486 
498  std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
499  std::unique_ptr<rmm::device_uvector<size_type>>>
500  inner_join(rmm::cuda_stream_view stream = cudf::get_default_stream(),
501  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) const;
502 
517  std::unique_ptr<rmm::device_uvector<size_type>> left_join(
518  rmm::cuda_stream_view stream = cudf::get_default_stream(),
519  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()) const;
520 
521  private:
522  using impl_type = typename cudf::detail::distinct_hash_join<HasNested>;
523 
524  std::unique_ptr<impl_type> _impl;
525 };
526 
562 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
563  std::unique_ptr<rmm::device_uvector<size_type>>>
565  table_view const& left,
566  table_view const& right,
567  ast::expression const& binary_predicate,
568  std::optional<std::size_t> output_size = {},
569  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
570 
608 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
609  std::unique_ptr<rmm::device_uvector<size_type>>>
611  table_view const& right,
612  ast::expression const& binary_predicate,
613  std::optional<std::size_t> output_size = {},
614  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
615 
651 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
652  std::unique_ptr<rmm::device_uvector<size_type>>>
654  table_view const& right,
655  ast::expression const& binary_predicate,
656  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
657 
690 std::unique_ptr<rmm::device_uvector<size_type>> conditional_left_semi_join(
691  table_view const& left,
692  table_view const& right,
693  ast::expression const& binary_predicate,
694  std::optional<std::size_t> output_size = {},
695  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
696 
729 std::unique_ptr<rmm::device_uvector<size_type>> conditional_left_anti_join(
730  table_view const& left,
731  table_view const& right,
732  ast::expression const& binary_predicate,
733  std::optional<std::size_t> output_size = {},
734  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
735 
782 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
783  std::unique_ptr<rmm::device_uvector<size_type>>>
785  table_view const& left_equality,
786  table_view const& right_equality,
787  table_view const& left_conditional,
788  table_view const& right_conditional,
789  ast::expression const& binary_predicate,
790  null_equality compare_nulls = null_equality::EQUAL,
791  std::optional<std::pair<std::size_t, device_span<size_type const>>> output_size_data = {},
792  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
793 
842 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
843  std::unique_ptr<rmm::device_uvector<size_type>>>
845  table_view const& left_equality,
846  table_view const& right_equality,
847  table_view const& left_conditional,
848  table_view const& right_conditional,
849  ast::expression const& binary_predicate,
850  null_equality compare_nulls = null_equality::EQUAL,
851  std::optional<std::pair<std::size_t, device_span<size_type const>>> output_size_data = {},
852  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
853 
902 std::pair<std::unique_ptr<rmm::device_uvector<size_type>>,
903  std::unique_ptr<rmm::device_uvector<size_type>>>
905  table_view const& left_equality,
906  table_view const& right_equality,
907  table_view const& left_conditional,
908  table_view const& right_conditional,
909  ast::expression const& binary_predicate,
910  null_equality compare_nulls = null_equality::EQUAL,
911  std::optional<std::pair<std::size_t, device_span<size_type const>>> output_size_data = {},
912  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
913 
955 std::unique_ptr<rmm::device_uvector<size_type>> mixed_left_semi_join(
956  table_view const& left_equality,
957  table_view const& right_equality,
958  table_view const& left_conditional,
959  table_view const& right_conditional,
960  ast::expression const& binary_predicate,
961  null_equality compare_nulls = null_equality::EQUAL,
962  std::optional<std::pair<std::size_t, device_span<size_type const>>> output_size_data = {},
963  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
964 
1007 std::unique_ptr<rmm::device_uvector<size_type>> mixed_left_anti_join(
1008  table_view const& left_equality,
1009  table_view const& right_equality,
1010  table_view const& left_conditional,
1011  table_view const& right_conditional,
1012  ast::expression const& binary_predicate,
1013  null_equality compare_nulls = null_equality::EQUAL,
1014  std::optional<std::pair<std::size_t, device_span<size_type const>>> output_size_data = {},
1015  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
1016 
1048 std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type>>> mixed_inner_join_size(
1049  table_view const& left_equality,
1050  table_view const& right_equality,
1051  table_view const& left_conditional,
1052  table_view const& right_conditional,
1053  ast::expression const& binary_predicate,
1054  null_equality compare_nulls = null_equality::EQUAL,
1055  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
1056 
1088 std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type>>> mixed_left_join_size(
1089  table_view const& left_equality,
1090  table_view const& right_equality,
1091  table_view const& left_conditional,
1092  table_view const& right_conditional,
1093  ast::expression const& binary_predicate,
1094  null_equality compare_nulls = null_equality::EQUAL,
1095  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
1096 
1128 std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type>>> mixed_left_semi_join_size(
1129  table_view const& left_equality,
1130  table_view const& right_equality,
1131  table_view const& left_conditional,
1132  table_view const& right_conditional,
1133  ast::expression const& binary_predicate,
1134  null_equality compare_nulls = null_equality::EQUAL,
1135  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
1136 
1166 std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type>>> mixed_left_anti_join_size(
1167  table_view const& left_equality,
1168  table_view const& right_equality,
1169  table_view const& left_conditional,
1170  table_view const& right_conditional,
1171  ast::expression const& binary_predicate,
1172  null_equality compare_nulls = null_equality::EQUAL,
1173  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
1174 
1193  table_view const& left,
1194  table_view const& right,
1195  ast::expression const& binary_predicate,
1196  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
1197 
1216  table_view const& left,
1217  table_view const& right,
1218  ast::expression const& binary_predicate,
1219  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
1220 
1239  table_view const& left,
1240  table_view const& right,
1241  ast::expression const& binary_predicate,
1242  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());
1243 
1262  table_view const& left,
1263  table_view const& right,
1264  ast::expression const& binary_predicate,
1265  rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource()); // end of group
1267 } // namespace cudf
Distinct hash join that builds hash table in creation and probes results in subsequent *_join member ...
Definition: join.hpp:462
std::unique_ptr< rmm::device_uvector< size_type > > left_join(rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource()) const
Returns the build table indices that can be used to construct the result of performing a left join be...
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > inner_join(rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource()) const
Returns the row indices that can be used to construct the result of performing an inner join between ...
distinct_hash_join(cudf::table_view const &build, cudf::table_view const &probe, nullable_join has_nulls=nullable_join::YES, null_equality compare_nulls=null_equality::EQUAL, rmm::cuda_stream_view stream=cudf::get_default_stream())
Constructs a distinct hash join object for subsequent probe calls.
Hash join that builds hash table in creation and probes results in subsequent *_join member functions...
Definition: join.hpp:283
hash_join(cudf::table_view const &build, nullable_join has_nulls, null_equality compare_nulls, rmm::cuda_stream_view stream=cudf::get_default_stream())
Construct a hash join object for subsequent probe calls.
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > inner_join(cudf::table_view const &probe, std::optional< std::size_t > output_size={}, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource()) const
typename cudf::detail::hash_join< cudf::hashing::detail::MurmurHash3_x86_32< cudf::hash_value_type > > impl_type
Implementation type.
Definition: join.hpp:286
std::size_t left_join_size(cudf::table_view const &probe, rmm::cuda_stream_view stream=cudf::get_default_stream()) const
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > full_join(cudf::table_view const &probe, std::optional< std::size_t > output_size={}, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource()) const
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > left_join(cudf::table_view const &probe, std::optional< std::size_t > output_size={}, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource()) const
std::size_t full_join_size(cudf::table_view const &probe, rmm::cuda_stream_view stream=cudf::get_default_stream(), rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource()) const
std::size_t inner_join_size(cudf::table_view const &probe, rmm::cuda_stream_view stream=cudf::get_default_stream()) const
hash_join(cudf::table_view const &build, null_equality compare_nulls, rmm::cuda_stream_view stream=cudf::get_default_stream())
Construct a hash join object for subsequent probe calls.
A set of cudf::column_view's of the same size.
Definition: table_view.hpp:187
std::size_t conditional_left_anti_join_size(table_view const &left, table_view const &right, ast::expression const &binary_predicate, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns the exact number of matches (rows) when performing a conditional left anti join between the s...
std::pair< std::size_t, std::unique_ptr< rmm::device_uvector< size_type > > > mixed_left_anti_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::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns the exact number of matches (rows) when performing a mixed left anti join between the specifi...
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::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
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 > > conditional_left_anti_join(table_view const &left, table_view const &right, ast::expression const &binary_predicate, std::optional< std::size_t > output_size={}, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns an index vector corresponding to all rows in the left table for which there does not exist an...
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, std::optional< std::pair< std::size_t, device_span< size_type const >>> output_size_data={}, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns an index vector corresponding to all rows in the left tables where the columns of the equalit...
std::unique_ptr< cudf::table > cross_join(cudf::table_view const &left, cudf::table_view const &right, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Performs a cross join on two tables (left, right)
std::unique_ptr< rmm::device_uvector< size_type > > left_anti_join(cudf::table_view const &left_keys, cudf::table_view const &right_keys, null_equality compare_nulls=null_equality::EQUAL, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns a vector of row indices corresponding to a left anti join between the specified tables.
std::unique_ptr< rmm::device_uvector< size_type > > left_semi_join(cudf::table_view const &left_keys, cudf::table_view const &right_keys, null_equality compare_nulls=null_equality::EQUAL, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns a vector of row indices corresponding to a left semi-join between the specified tables.
has_nested
Enum to indicate whether the distinct join table has nested columns or not.
Definition: join.hpp:41
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::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
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 > > > full_join(cudf::table_view const &left_keys, cudf::table_view const &right_keys, null_equality compare_nulls=null_equality::EQUAL, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns a pair of row index vectors corresponding to a full join between the specified tables.
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > conditional_full_join(table_view const &left, table_view const &right, ast::expression const &binary_predicate, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
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_semi_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::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns the exact number of matches (rows) when performing a mixed left semi join between the specifi...
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, std::optional< std::pair< std::size_t, device_span< size_type const >>> output_size_data={}, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns an index vector corresponding to all rows in the left tables for which there is no row in the...
nullable_join
The enum class to specify if any of the input join tables (build table and any later probe table) has...
Definition: join.hpp:274
std::size_t conditional_left_join_size(table_view const &left, table_view const &right, ast::expression const &binary_predicate, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns the exact number of matches (rows) when performing a conditional left join between the specif...
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::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
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 > > > left_join(cudf::table_view const &left_keys, cudf::table_view const &right_keys, null_equality compare_nulls=null_equality::EQUAL, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns a pair of row index vectors corresponding to a left join between the specified tables.
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > conditional_inner_join(table_view const &left, table_view const &right, ast::expression const &binary_predicate, std::optional< std::size_t > output_size={}, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns a pair of row index vectors corresponding to all pairs of rows between the specified tables w...
std::size_t conditional_inner_join_size(table_view const &left, table_view const &right, ast::expression const &binary_predicate, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns the exact number of matches (rows) when performing a conditional inner join between the speci...
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > conditional_left_join(table_view const &left, table_view const &right, ast::expression const &binary_predicate, std::optional< std::size_t > output_size={}, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
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::pair< std::size_t, device_span< size_type const >>> output_size_data={}, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
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::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
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 > > > inner_join(cudf::table_view const &left_keys, cudf::table_view const &right_keys, null_equality compare_nulls=null_equality::EQUAL, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns a pair of row index vectors corresponding to an inner join between the specified tables.
std::size_t conditional_left_semi_join_size(table_view const &left, table_view const &right, ast::expression const &binary_predicate, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns the exact number of matches (rows) when performing a conditional left semi join between the s...
std::unique_ptr< rmm::device_uvector< size_type > > conditional_left_semi_join(table_view const &left, table_view const &right, ast::expression const &binary_predicate, std::optional< std::size_t > output_size={}, rmm::mr::device_memory_resource *mr=rmm::mr::get_current_device_resource())
Returns an index vector corresponding to all rows in the left table for which there exists some row i...
rmm::cuda_stream_view const get_default_stream()
Get the current default stream.
null_equality
Enum to consider two nulls as equal or unequal.
Definition: types.hpp:149
@ EQUAL
nulls compare equal
cuDF interfaces
Definition: aggregation.hpp:34
bool has_nulls(table_view const &view)
Returns True if the table has nulls in any of its columns.
APIs for spans.
A generic expression that can be evaluated to return a value.
Definition: expressions.hpp:46
Device version of C++20 std::span with reduced feature set.
Definition: span.hpp:291
Class definitions for (mutable)_table_view
Type declarations for libcudf.