Skip to content

Commit

Permalink
Merge pull request #14449 from rapidsai/branch-23.12
Browse files Browse the repository at this point in the history
Forward-merge branch-23.12 to branch-24.02
  • Loading branch information
GPUtester authored Nov 18, 2023
2 parents 10218a9 + 723c565 commit 9971790
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cpp/include/cudf/ast/detail/expression_parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ struct alignas(8) device_data_reference {

bool operator==(device_data_reference const& rhs) const
{
return std::tie(data_index, reference_type, table_source) ==
std::tie(rhs.data_index, rhs.reference_type, rhs.table_source);
return std::tie(data_index, data_type, reference_type, table_source) ==
std::tie(rhs.data_index, rhs.data_type, rhs.reference_type, rhs.table_source);
}
};

Expand Down
27 changes: 27 additions & 0 deletions cpp/tests/ast/transform_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,33 @@ TEST_F(TransformTest, ImbalancedTreeArithmetic)
CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, result->view(), verbosity);
}

TEST_F(TransformTest, ImbalancedTreeArithmeticDeep)
{
auto c_0 = column_wrapper<int64_t>{4, 5, 6};
auto table = cudf::table_view{{c_0}};

auto col_ref_0 = cudf::ast::column_reference(0);

// expression: (c0 < c0) == (c0 < (c0 + c0))
// {false, false, false} == (c0 < {8, 10, 12})
// {false, false, false} == {true, true, true}
// {false, false, false}
auto expression_left_subtree =
cudf::ast::operation(cudf::ast::ast_operator::LESS, col_ref_0, col_ref_0);
auto expression_right_inner_subtree =
cudf::ast::operation(cudf::ast::ast_operator::ADD, col_ref_0, col_ref_0);
auto expression_right_subtree =
cudf::ast::operation(cudf::ast::ast_operator::LESS, col_ref_0, expression_right_inner_subtree);

auto expression_tree = cudf::ast::operation(
cudf::ast::ast_operator::EQUAL, expression_left_subtree, expression_right_subtree);

auto result = cudf::compute_column(table, expression_tree);
auto expected = column_wrapper<bool>{false, false, false};

CUDF_TEST_EXPECT_COLUMNS_EQUAL(expected, result->view(), verbosity);
}

TEST_F(TransformTest, MultiLevelTreeComparator)
{
auto c_0 = column_wrapper<int32_t>{3, 20, 1, 50};
Expand Down

0 comments on commit 9971790

Please sign in to comment.