-
Notifications
You must be signed in to change notification settings - Fork 917
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] copy_if_else producing incorrect answers for structs #8356
Labels
Milestone
Comments
revans2
added
bug
Something isn't working
Needs Triage
Need team to review and classify
Spark
Functionality that helps Spark RAPIDS
labels
May 25, 2021
a smaller repro: diff --git a/cpp/tests/copying/copy_if_else_nested_tests.cpp b/cpp/tests/copying/copy_if_else_nested_tests.cpp
index 9ac34a3044..0f7fc625e4 100644
--- a/cpp/tests/copying/copy_if_else_nested_tests.cpp
+++ b/cpp/tests/copying/copy_if_else_nested_tests.cpp
@@ -102,6 +102,34 @@ TYPED_TEST(TypedCopyIfElseNestedTest, StructsWithNulls)
CUDF_TEST_EXPECT_COLUMNS_EQUIVALENT(result_column->view(), expected_result->view());
}
+TYPED_TEST(TypedCopyIfElseNestedTest, ReflectiveStructsWithNulls)
+{
+ using T = TypeParam;
+
+ using namespace cudf;
+ using namespace cudf::test;
+
+ using ints = fixed_width_column_wrapper<T, int32_t>;
+ using structs = structs_column_wrapper;
+ using bools = fixed_width_column_wrapper<bool, int32_t>;
+
+ auto selector_column = bools{0, 1}.release();
+
+ auto lhs_child_0 = ints{{100, 101}, iterator_with_null_at(std::vector<size_type>{1})};
+
+ auto lhs_structs_column = structs{{lhs_child_0}}.release();
+
+ cudf::test::print(*lhs_structs_column);
+
+ auto result_column =
+ copy_if_else(lhs_structs_column->view(), lhs_structs_column->view(), selector_column->view());
+
+ std::cout << "result: " << std::endl;
+ cudf::test::print(*result_column);
+
+ CUDF_TEST_EXPECT_COLUMNS_EQUIVALENT(result_column->view(), lhs_structs_column->view());
+}
+
TYPED_TEST(TypedCopyIfElseNestedTest, Lists)
{
using T = TypeParam; |
As for SIGSEGV:
|
gerashegalov
added a commit
to gerashegalov/cudf
that referenced
this issue
Jun 12, 2021
Simplifies copy_if_else by skipping gather on lhs, and using lhs directly as the rhs scatter destinations for 0-rows in select col. Closes rapidsai#8356 Co-authored-by: MithunR <[email protected]>
rapids-bot bot
pushed a commit
that referenced
this issue
Jun 14, 2021
Fixes the scatter map size to the target column size. Simplifies `copy_if_else` by skipping gather on lhs, and using lhs directly as the rhs scatter destinations for 0-rows in select col. Closes #8356 Co-authored-by: @mythrocks Authors: - Gera Shegalov (https://github.com/gerashegalov) Approvers: - Nghia Truong (https://github.com/ttnghia) - Mark Harris (https://github.com/harrism) - MithunR (https://github.com/mythrocks) URL: #8507
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
When trying to implement
Case/When
andIf/Else
for Spark for Structs I ran into a test that was failing. I brought the size of the test data down a lot, but it looks like NULLs are being inserted into incorrect places for some result/Steps/Code to reproduce bug
Expected behavior
The test should pass because the the lhs and rhs of the copy_if_else is the same thing so I don't see how we would ever get anything back except the lhs, but we get back a different answer (and some how it also crashes, which is separate)
The text was updated successfully, but these errors were encountered: