Skip to content

Commit

Permalink
Add early exit before the actual probe occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
PointKernel committed Feb 12, 2022
1 parent d1c488d commit f9b1d3d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions cpp/src/join/join.cu
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,15 @@ std::unique_ptr<table> left_join(table_view const& left_input,
table_view const left = scatter_columns(matched.second.front(), left_on, left_input);
table_view const right = scatter_columns(matched.second.back(), right_on, right_input);

auto const [left_join_indices, right_join_indices] = cudf::detail::left_join(
left.select(left_on), right.select(right_on), compare_nulls, stream, mr);

if ((left_on.empty() || right_on.empty()) ||
is_trivial_join(left, right, cudf::detail::join_kind::LEFT_JOIN)) {
if ((left_on.empty() or right_on.empty()) or
cudf::detail::is_trivial_join(left, right, cudf::detail::join_kind::LEFT_JOIN)) {
auto [left_empty_table, right_empty_table] = get_empty_joined_table(left, right);
return cudf::detail::combine_table_pair(std::move(left_empty_table),
std::move(right_empty_table));
}

auto const [left_join_indices, right_join_indices] = cudf::detail::left_join(
left.select(left_on), right.select(right_on), compare_nulls, stream, mr);
std::unique_ptr<table> left_result = detail::gather(left,
left_join_indices->begin(),
left_join_indices->end(),
Expand Down Expand Up @@ -199,15 +199,15 @@ std::unique_ptr<table> full_join(table_view const& left_input,
table_view const left = scatter_columns(matched.second.front(), left_on, left_input);
table_view const right = scatter_columns(matched.second.back(), right_on, right_input);

auto const [left_join_indices, right_join_indices] = cudf::detail::full_join(
left.select(left_on), right.select(right_on), compare_nulls, stream, mr);

if ((left_on.empty() || right_on.empty()) ||
is_trivial_join(left, right, cudf::detail::join_kind::FULL_JOIN)) {
if ((left_on.empty() or right_on.empty()) or
cudf::detail::is_trivial_join(left, right, cudf::detail::join_kind::FULL_JOIN)) {
auto [left_empty_table, right_empty_table] = get_empty_joined_table(left, right);
return cudf::detail::combine_table_pair(std::move(left_empty_table),
std::move(right_empty_table));
}

auto const [left_join_indices, right_join_indices] = cudf::detail::full_join(
left.select(left_on), right.select(right_on), compare_nulls, stream, mr);
std::unique_ptr<table> left_result = detail::gather(left,
left_join_indices->begin(),
left_join_indices->end(),
Expand Down

0 comments on commit f9b1d3d

Please sign in to comment.