Files | Classes | Enumerations | Functions

Files

file  join.hpp
 

Classes

class  cudf::hash_join
 Hash join that builds hash table in creation and probes results in subsequent *_join member functions. More...
 
class  cudf::distinct_hash_join< HasNested >
 Distinct hash join that builds hash table in creation and probes results in subsequent *_join member functions. More...
 

Enumerations

enum class  cudf::has_nested : bool { YES , NO }
 Enum to indicate whether the distinct join table has nested columns or not.
 
enum class  cudf::nullable_join : bool { YES , NO }
 The enum class to specify if any of the input join tables (build table and any later probe table) has nulls. More...
 

Functions

std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > cudf::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. More...
 
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > cudf::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. More...
 
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > cudf::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. More...
 
std::unique_ptr< rmm::device_uvector< size_type > > cudf::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. More...
 
std::unique_ptr< rmm::device_uvector< size_type > > cudf::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. More...
 
std::unique_ptr< cudf::tablecudf::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) More...
 
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > cudf::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 where the predicate evaluates to true. More...
 
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > cudf::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 where the predicate evaluates to true, or null matches for rows in left that have no match in right. More...
 
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > cudf::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 where the predicate evaluates to true, or null matches for rows in either table that have no match in the other. More...
 
std::unique_ptr< rmm::device_uvector< size_type > > cudf::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 in the right table where the predicate evaluates to true. More...
 
std::unique_ptr< rmm::device_uvector< size_type > > cudf::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 any row in the right table where the predicate evaluates to true. More...
 
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > cudf::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 where the columns of the equality table are equal and the predicate evaluates to true on the conditional tables. More...
 
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > cudf::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 where the columns of the equality table are equal and the predicate evaluates to true on the conditional tables, or null matches for rows in left that have no match in right. More...
 
std::pair< std::unique_ptr< rmm::device_uvector< size_type > >, std::unique_ptr< rmm::device_uvector< size_type > > > cudf::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 where the columns of the equality table are equal and the predicate evaluates to true on the conditional tables, or null matches for rows in either pair of tables that have no matches in the other pair. More...
 
std::unique_ptr< rmm::device_uvector< size_type > > cudf::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 equality table are equal and the predicate evaluates to true on the conditional tables. More...
 
std::unique_ptr< rmm::device_uvector< size_type > > cudf::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 right tables where the columns of the equality table are equal and the predicate evaluates to true on the conditional tables. More...
 
std::pair< std::size_t, std::unique_ptr< rmm::device_uvector< size_type > > > cudf::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 tables where the columns of the equality table are equal and the predicate evaluates to true on the conditional tables. More...
 
std::pair< std::size_t, std::unique_ptr< rmm::device_uvector< size_type > > > cudf::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 tables where the columns of the equality table are equal and the predicate evaluates to true on the conditional tables. More...
 
std::pair< std::size_t, std::unique_ptr< rmm::device_uvector< size_type > > > cudf::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 specified tables where the columns of the equality table are equal and the predicate evaluates to true on the conditional tables. More...
 
std::pair< std::size_t, std::unique_ptr< rmm::device_uvector< size_type > > > cudf::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 specified tables. More...
 
std::size_t cudf::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 specified tables where the predicate evaluates to true. More...
 
std::size_t cudf::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 specified tables where the predicate evaluates to true. More...
 
std::size_t cudf::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 specified tables where the predicate evaluates to true. More...
 
std::size_t cudf::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 specified tables where the predicate evaluates to true. More...
 

Detailed Description

Enumeration Type Documentation

◆ nullable_join

enum cudf::nullable_join : bool
strong

The enum class to specify if any of the input join tables (build table and any later probe table) has nulls.

This is used upon hash_join object construction to specify the existence of nulls in all the possible input tables. If such null existence is unknown, YES should be used as the default option.

Definition at line 274 of file join.hpp.

Function Documentation

◆ conditional_full_join()

std::pair<std::unique_ptr<rmm::device_uvector<size_type> >, std::unique_ptr<rmm::device_uvector<size_type> > > cudf::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 where the predicate evaluates to true, or null matches for rows in either table that have no match in the other.

Taken pairwise, the values from the returned vectors are one of: (1) row indices corresponding to matching rows from the left and right tables, (2) a row index and an unspecified out-of-bounds value, representing a row from one table without a match in the other.

If the provided predicate returns NULL for a pair of rows (left, right), that pair is not included in the output.

Left: {{0, 1, 2}}
Right: {{1, 2, 3}}
Expression: Left.Column_0 == Right.Column_0
Result: {{0, 1, 2, None}, {None, 0, 1, 2}}
Left: {{0, 1, 2}, {3, 4, 5}}
Right: {{1, 2, 3}, {4, 6, 7}}
Expression: (Left.Column_0 == Right.Column_0) AND (Left.Column_1 == Right.Column_1)
Result: {{0, 1, 2, None, None}, {None, 0, None, 1, 2}}
Exceptions
cudf::logic_errorif the binary predicate outputs a non-boolean result.
Parameters
leftThe left table
rightThe right table
binary_predicateThe condition on which to join
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A pair of vectors [left_indices, right_indices] that can be used to construct the result of performing a conditional full join between two tables left and right .

◆ conditional_inner_join()

std::pair<std::unique_ptr<rmm::device_uvector<size_type> >, std::unique_ptr<rmm::device_uvector<size_type> > > cudf::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 where the predicate evaluates to true.

The first returned vector contains the row indices from the left table that have a match in the right table (in unspecified order). The corresponding values in the second returned vector are the matched row indices from the right table.

If the provided predicate returns NULL for a pair of rows (left, right), that pair is not included in the output.

Left: {{0, 1, 2}}
Right: {{1, 2, 3}}
Expression: Left.Column_0 == Right.Column_0
Result: {{1, 2}, {0, 1}}
Left: {{0, 1, 2}, {3, 4, 5}}
Right: {{1, 2, 3}, {4, 6, 7}}
Expression: (Left.Column_0 == Right.Column_0) AND (Left.Column_1 == Right.Column_1)
Result: {{1}, {0}}
Exceptions
cudf::logic_errorif the binary predicate outputs a non-boolean result.
Parameters
leftThe left table
rightThe right table
binary_predicateThe condition on which to join
output_sizeOptional value which allows users to specify the exact output size
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A pair of vectors [left_indices, right_indices] that can be used to construct the result of performing a conditional inner join between two tables left and right .

◆ conditional_inner_join_size()

std::size_t cudf::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 specified tables where the predicate evaluates to true.

If the provided predicate returns NULL for a pair of rows (left, right), that pair is not included in the output.

Exceptions
cudf::logic_errorif the binary predicate outputs a non-boolean result.
Parameters
leftThe left table
rightThe right table
binary_predicateThe condition on which to join
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
The size that would result from performing the requested join

◆ conditional_left_anti_join()

std::unique_ptr<rmm::device_uvector<size_type> > cudf::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 any row in the right table where the predicate evaluates to true.

If the provided predicate returns NULL for a pair of rows (left, right), that pair is not included in the output.

Left: {{0, 1, 2}}
Right: {{1, 2, 3}}
Expression: Left.Column_0 == Right.Column_0
Result: {0}
Left: {{0, 1, 2}, {3, 4, 5}}
Right: {{1, 2, 3}, {4, 6, 7}}
Expression: (Left.Column_0 == Right.Column_0) AND (Left.Column_1 == Right.Column_1)
Result: {0, 2}
Exceptions
cudf::logic_errorif the binary predicate outputs a non-boolean result.
Parameters
leftThe left table
rightThe right table
binary_predicateThe condition on which to join
output_sizeOptional value which allows users to specify the exact output size
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A vector left_indices that can be used to construct the result of performing a conditional left anti join between two tables left and right .

◆ conditional_left_anti_join_size()

std::size_t cudf::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 specified tables where the predicate evaluates to true.

If the provided predicate returns NULL for a pair of rows (left, right), that pair is not included in the output.

Exceptions
cudf::logic_errorif the binary predicate outputs a non-boolean result.
Parameters
leftThe left table
rightThe right table
binary_predicateThe condition on which to join
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
The size that would result from performing the requested join

◆ conditional_left_join()

std::pair<std::unique_ptr<rmm::device_uvector<size_type> >, std::unique_ptr<rmm::device_uvector<size_type> > > cudf::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 where the predicate evaluates to true, or null matches for rows in left that have no match in right.

The first returned vector contains all the row indices from the left table (in unspecified order). The corresponding value in the second returned vector is either (1) the row index of the matched row from the right table, if there is a match or (2) an unspecified out-of-bounds value.

If the provided predicate returns NULL for a pair of rows (left, right), that pair is not included in the output.

Left: {{0, 1, 2}}
Right: {{1, 2, 3}}
Expression: Left.Column_0 == Right.Column_0
Result: {{0, 1, 2}, {None, 0, 1}}
Left: {{0, 1, 2}, {3, 4, 5}}
Right: {{1, 2, 3}, {4, 6, 7}}
Expression: (Left.Column_0 == Right.Column_0) AND (Left.Column_1 == Right.Column_1)
Result: {{0, 1, 2}, {None, 0, None}}
Exceptions
cudf::logic_errorif the binary predicate outputs a non-boolean result.
Parameters
leftThe left table
rightThe right table
binary_predicateThe condition on which to join
output_sizeOptional value which allows users to specify the exact output size
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A pair of vectors [left_indices, right_indices] that can be used to construct the result of performing a conditional left join between two tables left and right .

◆ conditional_left_join_size()

std::size_t cudf::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 specified tables where the predicate evaluates to true.

If the provided predicate returns NULL for a pair of rows (left, right), that pair is not included in the output.

Exceptions
cudf::logic_errorif the binary predicate outputs a non-boolean result.
Parameters
leftThe left table
rightThe right table
binary_predicateThe condition on which to join
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
The size that would result from performing the requested join

◆ conditional_left_semi_join()

std::unique_ptr<rmm::device_uvector<size_type> > cudf::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 in the right table where the predicate evaluates to true.

If the provided predicate returns NULL for a pair of rows (left, right), that pair is not included in the output.

Left: {{0, 1, 2}}
Right: {{1, 2, 3}}
Expression: Left.Column_0 == Right.Column_0
Result: {1, 2}
Left: {{0, 1, 2}, {3, 4, 5}}
Right: {{1, 2, 3}, {4, 6, 7}}
Expression: (Left.Column_0 == Right.Column_0) AND (Left.Column_1 == Right.Column_1)
Result: {1}
Exceptions
cudf::logic_errorif the binary predicate outputs a non-boolean result.
Parameters
leftThe left table
rightThe right table
binary_predicateThe condition on which to join
output_sizeOptional value which allows users to specify the exact output size
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A vector left_indices that can be used to construct the result of performing a conditional left semi join between two tables left and right .

◆ conditional_left_semi_join_size()

std::size_t cudf::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 specified tables where the predicate evaluates to true.

If the provided predicate returns NULL for a pair of rows (left, right), that pair is not included in the output.

Exceptions
cudf::logic_errorif the binary predicate outputs a non-boolean result.
Parameters
leftThe left table
rightThe right table
binary_predicateThe condition on which to join
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
The size that would result from performing the requested join

◆ cross_join()

std::unique_ptr<cudf::table> cudf::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)

The cross join returns the cartesian product of rows from each table.

Note
Warning: This function can easily cause out-of-memory errors. The size of the output is equal to left.num_rows() * right.num_rows(). Use with caution.
Left a: {0, 1, 2}
Right b: {3, 4, 5}
Result: { a: {0, 0, 0, 1, 1, 1, 2, 2, 2}, b: {3, 4, 5, 3, 4, 5, 3, 4, 5} }
Exceptions
cudf::logic_errorif the number of columns in either left or right table is 0
Parameters
leftThe left table
rightThe right table
mrDevice memory resource used to allocate the returned table's device memory
Returns
Result of cross joining left and right tables

◆ full_join()

std::pair<std::unique_ptr<rmm::device_uvector<size_type> >, std::unique_ptr<rmm::device_uvector<size_type> > > cudf::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.

Taken pairwise, the values from the returned vectors are one of: (1) row indices corresponding to matching rows from the left and right tables, (2) a row index and an unspecified out-of-bounds value, representing a row from one table without a match in the other.

Left: {{0, 1, 2}}
Right: {{1, 2, 3}}
Result: {{0, 1, 2, None}, {None, 0, 1, 2}}
Left: {{0, 1, 2}, {3, 4, 5}}
Right: {{1, 2, 3}, {4, 6, 7}}
Result: {{0, 1, 2, None, None}, {None, 0, None, 1, 2}}
Exceptions
cudf::logic_errorif number of elements in left_keys or right_keys mismatch.
Parameters
[in]left_keysThe left table
[in]right_keysThe right table
[in]compare_nullscontrols whether null join-key values should match or not.
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A pair of vectors [left_indices, right_indices] that can be used to construct the result of performing a full join between two tables with left_keys and right_keys as the join keys .

◆ inner_join()

std::pair<std::unique_ptr<rmm::device_uvector<size_type> >, std::unique_ptr<rmm::device_uvector<size_type> > > cudf::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.

The first returned vector contains the row indices from the left table that have a match in the right table (in unspecified order). The corresponding values in the second returned vector are the matched row indices from the right table.

Left: {{0, 1, 2}}
Right: {{1, 2, 3}}
Result: {{1, 2}, {0, 1}}
Left: {{0, 1, 2}, {3, 4, 5}}
Right: {{1, 2, 3}, {4, 6, 7}}
Result: {{1}, {0}}
Exceptions
cudf::logic_errorif number of elements in left_keys or right_keys mismatch.
Parameters
[in]left_keysThe left table
[in]right_keysThe right table
[in]compare_nullscontrols whether null join-key values should match or not.
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A pair of vectors [left_indices, right_indices] that can be used to construct the result of performing an inner join between two tables with left_keys and right_keys as the join keys .

◆ left_anti_join()

std::unique_ptr<rmm::device_uvector<size_type> > cudf::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.

The returned vector contains the row indices from the left table for which there is no matching row in the right table.

TableA: {{0, 1, 2}}
TableB: {{1, 2, 3}}
Result: {0}
Exceptions
cudf::logic_errorif the number of columns in either left_keys or right_keys is 0
Parameters
[in]left_keysThe left table
[in]right_keysThe right table
[in]compare_nullscontrols whether null join-key values should match or not.
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A column left_indices that can be used to construct the result of performing a left anti join between two tables with left_keys and right_keys as the join keys .

◆ left_join()

std::pair<std::unique_ptr<rmm::device_uvector<size_type> >, std::unique_ptr<rmm::device_uvector<size_type> > > cudf::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.

The first returned vector contains all the row indices from the left table (in unspecified order). The corresponding value in the second returned vector is either (1) the row index of the matched row from the right table, if there is a match or (2) an unspecified out-of-bounds value.

Left: {{0, 1, 2}}
Right: {{1, 2, 3}}
Result: {{0, 1, 2}, {None, 0, 1}}
Left: {{0, 1, 2}, {3, 4, 5}}
Right: {{1, 2, 3}, {4, 6, 7}}
Result: {{0, 1, 2}, {None, 0, None}}
Exceptions
cudf::logic_errorif number of elements in left_keys or right_keys mismatch.
Parameters
[in]left_keysThe left table
[in]right_keysThe right table
[in]compare_nullscontrols whether null join-key values should match or not.
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A pair of vectors [left_indices, right_indices] that can be used to construct the result of performing a left join between two tables with left_keys and right_keys as the join keys .

◆ left_semi_join()

std::unique_ptr<rmm::device_uvector<size_type> > cudf::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.

The returned vector contains the row indices from the left table for which there is a matching row in the right table.

TableA: {{0, 1, 2}}
TableB: {{1, 2, 3}}
Result: {1, 2}
Parameters
left_keysThe left table
right_keysThe right table
compare_nullsControls whether null join-key values should match or not
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A vector left_indices that can be used to construct the result of performing a left semi join between two tables with left_keys and right_keys as the join keys .

◆ mixed_full_join()

std::pair<std::unique_ptr<rmm::device_uvector<size_type> >, std::unique_ptr<rmm::device_uvector<size_type> > > cudf::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 where the columns of the equality table are equal and the predicate evaluates to true on the conditional tables, or null matches for rows in either pair of tables that have no matches in the other pair.

Taken pairwise, the values from the returned vectors are one of: (1) row indices corresponding to matching rows from the left and right tables, (2) a row index and an unspecified out-of-bounds value, representing a row from one table without a match in the other.

If the provided predicate returns NULL for a pair of rows (left, right), that pair is not included in the output. It is the user's responsibility to choose a suitable compare_nulls value AND use appropriate null-safe operators in the expression.

If the provided output size or per-row counts are incorrect, behavior is undefined.

left_equality: {{0, 1, 2}}
right_equality: {{1, 2, 3}}
left_conditional: {{4, 4, 4}}
right_conditional: {{3, 4, 5}}
Expression: Left.Column_0 > Right.Column_0
Result: {{0, 1, 2, None, None}, {None, 0, None, 1, 2}}
Exceptions
cudf::logic_errorIf the binary predicate outputs a non-boolean result.
cudf::logic_errorIf the number of rows in left_equality and left_conditional do not match.
cudf::logic_errorIf the number of rows in right_equality and right_conditional do not match.
Parameters
left_equalityThe left table used for the equality join
right_equalityThe right table used for the equality join
left_conditionalThe left table used for the conditional join
right_conditionalThe right table used for the conditional join
binary_predicateThe condition on which to join
compare_nullsWhether or not null values join to each other or not
output_size_dataAn optional pair of values indicating the exact output size and the number of matches for each row in the larger of the two input tables, left or right (may be precomputed using the corresponding mixed_full_join_size API).
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A pair of vectors [left_indices, right_indices] that can be used to construct the result of performing a mixed full join between the four input tables.

◆ mixed_inner_join()

std::pair<std::unique_ptr<rmm::device_uvector<size_type> >, std::unique_ptr<rmm::device_uvector<size_type> > > cudf::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 where the columns of the equality table are equal and the predicate evaluates to true on the conditional tables.

The first returned vector contains the row indices from the left table that have a match in the right table (in unspecified order). The corresponding values in the second returned vector are the matched row indices from the right table.

If the provided predicate returns NULL for a pair of rows (left, right), that pair is not included in the output. It is the user's responsibility to choose a suitable compare_nulls value AND use appropriate null-safe operators in the expression.

If the provided output size or per-row counts are incorrect, behavior is undefined.

left_equality: {{0, 1, 2}}
right_equality: {{1, 2, 3}}
left_conditional: {{4, 4, 4}}
right_conditional: {{3, 4, 5}}
Expression: Left.Column_0 > Right.Column_0
Result: {{1}, {0}}
Exceptions
cudf::logic_errorIf the binary predicate outputs a non-boolean result.
cudf::logic_errorIf the number of rows in left_equality and left_conditional do not match.
cudf::logic_errorIf the number of rows in right_equality and right_conditional do not match.
Parameters
left_equalityThe left table used for the equality join
right_equalityThe right table used for the equality join
left_conditionalThe left table used for the conditional join
right_conditionalThe right table used for the conditional join
binary_predicateThe condition on which to join
compare_nullsWhether or not null values join to each other or not
output_size_dataAn optional pair of values indicating the exact output size and the number of matches for each row in the larger of the two input tables, left or right (may be precomputed using the corresponding mixed_inner_join_size API).
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A pair of vectors [left_indices, right_indices] that can be used to construct the result of performing a mixed inner join between the four input tables.

◆ mixed_inner_join_size()

std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type> > > cudf::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 tables where the columns of the equality table are equal and the predicate evaluates to true on the conditional tables.

If the provided predicate returns NULL for a pair of rows (left, right), that pair is not included in the output. It is the user's responsibility to choose a suitable compare_nulls value AND use appropriate null-safe operators in the expression.

Exceptions
cudf::logic_errorIf the binary predicate outputs a non-boolean result.
cudf::logic_errorIf the number of rows in left_equality and left_conditional do not match.
cudf::logic_errorIf the number of rows in right_equality and right_conditional do not match.
Parameters
left_equalityThe left table used for the equality join
right_equalityThe right table used for the equality join
left_conditionalThe left table used for the conditional join
right_conditionalThe right table used for the conditional join
binary_predicateThe condition on which to join
compare_nullsWhether or not null values join to each other or not
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A pair containing the size that would result from performing the requested join and the number of matches for each row in one of the two tables. Which of the two tables is an implementation detail and should not be relied upon, simply passed to the corresponding mixed_inner_join API as is.

◆ mixed_left_anti_join()

std::unique_ptr<rmm::device_uvector<size_type> > cudf::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 right tables where the columns of the equality table are equal and the predicate evaluates to true on the conditional tables.

If the provided predicate returns NULL for a pair of rows (left, right), the left row is not included in the output. It is the user's responsibility to choose a suitable compare_nulls value AND use appropriate null-safe operators in the expression.

If the provided output size or per-row counts are incorrect, behavior is undefined.

left_equality: {{0, 1, 2}}
right_equality: {{1, 2, 3}}
left_conditional: {{4, 4, 4}}
right_conditional: {{3, 4, 5}}
Expression: Left.Column_0 > Right.Column_0
Result: {0, 2}
Exceptions
cudf::logic_errorIf the binary predicate outputs a non-boolean result.
cudf::logic_errorIf the number of rows in left_equality and left_conditional do not match.
cudf::logic_errorIf the number of rows in right_equality and right_conditional do not match.
Parameters
left_equalityThe left table used for the equality join
right_equalityThe right table used for the equality join
left_conditionalThe left table used for the conditional join
right_conditionalThe right table used for the conditional join
binary_predicateThe condition on which to join
compare_nullsWhether or not null values join to each other or not
output_size_dataAn optional pair of values indicating the exact output size and the number of matches for each row in the larger of the two input tables, left or right (may be precomputed using the corresponding mixed_full_join_size API).
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A pair of vectors [left_indices, right_indices] that can be used to construct the result of performing a mixed full join between the four input tables.

◆ mixed_left_anti_join_size()

std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type> > > cudf::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 specified tables.

If the provided predicate returns NULL for a pair of rows (left, right), that pair is not included in the output. It is the user's responsibility to choose a suitable compare_nulls value AND use appropriate null-safe operators in the expression.

Exceptions
cudf::logic_errorIf the binary predicate outputs a non-boolean result.
cudf::logic_errorIf the number of rows in left_equality and left_conditional do not match.
cudf::logic_errorIf the number of rows in right_equality and right_conditional do not match.
Parameters
left_equalityThe left table used for the equality join
right_equalityThe right table used for the equality join
left_conditionalThe left table used for the conditional join
right_conditionalThe right table used for the conditional join
binary_predicateThe condition on which to join
compare_nullsWhether or not null values join to each other or not
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A pair containing the size that would result from performing the requested join and the number of matches for each row in one of the two tables. Which of the two tables is an implementation detail and should not be relied upon, simply passed to the corresponding mixed_left_join API as is.

◆ mixed_left_join()

std::pair<std::unique_ptr<rmm::device_uvector<size_type> >, std::unique_ptr<rmm::device_uvector<size_type> > > cudf::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 where the columns of the equality table are equal and the predicate evaluates to true on the conditional tables, or null matches for rows in left that have no match in right.

The first returned vector contains the row indices from the left tables that have a match in the right tables (in unspecified order). The corresponding value in the second returned vector is either (1) the row index of the matched row from the right tables, or (2) an unspecified out-of-bounds value.

If the provided predicate returns NULL for a pair of rows (left, right), that pair is not included in the output. It is the user's responsibility to choose a suitable compare_nulls value AND use appropriate null-safe operators in the expression.

If the provided output size or per-row counts are incorrect, behavior is undefined.

left_equality: {{0, 1, 2}}
right_equality: {{1, 2, 3}}
left_conditional: {{4, 4, 4}}
right_conditional: {{3, 4, 5}}
Expression: Left.Column_0 > Right.Column_0
Result: {{0, 1, 2}, {None, 0, None}}
Exceptions
cudf::logic_errorIf the binary predicate outputs a non-boolean result.
cudf::logic_errorIf the number of rows in left_equality and left_conditional do not match.
cudf::logic_errorIf the number of rows in right_equality and right_conditional do not match.
Parameters
left_equalityThe left table used for the equality join
right_equalityThe right table used for the equality join
left_conditionalThe left table used for the conditional join
right_conditionalThe right table used for the conditional join
binary_predicateThe condition on which to join
compare_nullsWhether or not null values join to each other or not
output_size_dataAn optional pair of values indicating the exact output size and the number of matches for each row in the larger of the two input tables, left or right (may be precomputed using the corresponding mixed_left_join_size API).
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A pair of vectors [left_indices, right_indices] that can be used to construct the result of performing a mixed left join between the four input tables.

◆ mixed_left_join_size()

std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type> > > cudf::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 tables where the columns of the equality table are equal and the predicate evaluates to true on the conditional tables.

If the provided predicate returns NULL for a pair of rows (left, right), that pair is not included in the output. It is the user's responsibility to choose a suitable compare_nulls value AND use appropriate null-safe operators in the expression.

Exceptions
cudf::logic_errorIf the binary predicate outputs a non-boolean result.
cudf::logic_errorIf the number of rows in left_equality and left_conditional do not match.
cudf::logic_errorIf the number of rows in right_equality and right_conditional do not match.
Parameters
left_equalityThe left table used for the equality join
right_equalityThe right table used for the equality join
left_conditionalThe left table used for the conditional join
right_conditionalThe right table used for the conditional join
binary_predicateThe condition on which to join
compare_nullsWhether or not null values join to each other or not
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A pair containing the size that would result from performing the requested join and the number of matches for each row in one of the two tables. Which of the two tables is an implementation detail and should not be relied upon, simply passed to the corresponding mixed_left_join API as is.

◆ mixed_left_semi_join()

std::unique_ptr<rmm::device_uvector<size_type> > cudf::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 equality table are equal and the predicate evaluates to true on the conditional tables.

If the provided predicate returns NULL for a pair of rows (left, right), the left row is not included in the output. It is the user's responsibility to choose a suitable compare_nulls value AND use appropriate null-safe operators in the expression.

If the provided output size or per-row counts are incorrect, behavior is undefined.

left_equality: {{0, 1, 2}}
right_equality: {{1, 2, 3}}
left_conditional: {{4, 4, 4}}
right_conditional: {{3, 4, 5}}
Expression: Left.Column_0 > Right.Column_0
Result: {1}
Exceptions
cudf::logic_errorIf the binary predicate outputs a non-boolean result.
cudf::logic_errorIf the number of rows in left_equality and left_conditional do not match.
cudf::logic_errorIf the number of rows in right_equality and right_conditional do not match.
Parameters
left_equalityThe left table used for the equality join
right_equalityThe right table used for the equality join
left_conditionalThe left table used for the conditional join
right_conditionalThe right table used for the conditional join
binary_predicateThe condition on which to join
compare_nullsWhether or not null values join to each other or not
output_size_dataAn optional pair of values indicating the exact output size and the number of matches for each row in the larger of the two input tables, left or right (may be precomputed using the corresponding mixed_full_join_size API).
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A pair of vectors [left_indices, right_indices] that can be used to construct the result of performing a mixed full join between the four input tables.

◆ mixed_left_semi_join_size()

std::pair<std::size_t, std::unique_ptr<rmm::device_uvector<size_type> > > cudf::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 specified tables where the columns of the equality table are equal and the predicate evaluates to true on the conditional tables.

If the provided predicate returns NULL for a pair of rows (left, right), that pair is not included in the output. It is the user's responsibility to choose a suitable compare_nulls value AND use appropriate null-safe operators in the expression.

Exceptions
cudf::logic_errorIf the binary predicate outputs a non-boolean result.
cudf::logic_errorIf the number of rows in left_equality and left_conditional do not match.
cudf::logic_errorIf the number of rows in right_equality and right_conditional do not match.
Parameters
left_equalityThe left table used for the equality join
right_equalityThe right table used for the equality join
left_conditionalThe left table used for the conditional join
right_conditionalThe right table used for the conditional join
binary_predicateThe condition on which to join
compare_nullsWhether or not null values join to each other or not
mrDevice memory resource used to allocate the returned table and columns' device memory
Returns
A pair containing the size that would result from performing the requested join and the number of matches for each row in one of the two tables. Which of the two tables is an implementation detail and should not be relied upon, simply passed to the corresponding mixed_left_join API as is.