Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Conditional join with empty left table throws exception #9044

Closed
jlowe opened this issue Aug 16, 2021 · 0 comments · Fixed by #9146
Closed

[BUG] Conditional join with empty left table throws exception #9044

jlowe opened this issue Aug 16, 2021 · 0 comments · Fixed by #9146
Assignees
Labels
bug Something isn't working libcudf Affects libcudf (C++/CUDA) code. Spark Functionality that helps Spark RAPIDS

Comments

@jlowe
Copy link
Member

jlowe commented Aug 16, 2021

Describe the bug
Performing a conditional join when the left table has zero rows throws the following exception:

cuDF failure at: ../include/cudf/detail/utilities/cuda.cuh:65: num_blocks must be > 0

Steps/Code to reproduce bug
Apply the following patch and run JOIN_TEST:

diff --git a/cpp/tests/join/conditional_join_tests.cu b/cpp/tests/join/conditional_join_tests.cu
index e16e1ec7de..ad70fe9a46 100644
--- a/cpp/tests/join/conditional_join_tests.cu
+++ b/cpp/tests/join/conditional_join_tests.cu
@@ -563,6 +563,16 @@ TYPED_TEST(ConditionalFullJoinTest, TestOneColumnNoneEqual)
               {JoinNoneValue, 2}});
 };
 
+TYPED_TEST(ConditionalFullJoinTest, TestOneColumnLeftEmpty)
+{
+  this->test({{}},
+             {{3, 4, 5}},
+             left_zero_eq_right_zero,
+             {{JoinNoneValue, 0},
+              {JoinNoneValue, 1},
+              {JoinNoneValue, 2}});
+};
+
 TYPED_TEST(ConditionalFullJoinTest, TestTwoColumnThreeRowSomeEqual)
 {
   this->test({{0, 1, 2}, {10, 20, 30}},

Note that this fails for other join types as well such as left and inner joins.

Expected behavior
Joins should not crash when given one or more empty tables as input.

@jlowe jlowe added bug Something isn't working libcudf Affects libcudf (C++/CUDA) code. Spark Functionality that helps Spark RAPIDS labels Aug 16, 2021
@harrism harrism assigned PointKernel and unassigned PointKernel Aug 16, 2021
@harrism harrism added this to the Conditional Joins milestone Aug 16, 2021
@rapids-bot rapids-bot bot closed this as completed in #9146 Sep 8, 2021
rapids-bot bot pushed a commit that referenced this issue Sep 8, 2021
Resolves #9044 by ensuring that when the left table is empty the functions short-circuit accordingly. Where necessary (i.e. for full joins) the complementary pairs of indices are returned.

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Nghia Truong (https://github.com/ttnghia)

URL: #9146
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working libcudf Affects libcudf (C++/CUDA) code. Spark Functionality that helps Spark RAPIDS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants