Skip to content

Commit

Permalink
Merge branch 'branch-23.12' into fea-nvjitlink
Browse files Browse the repository at this point in the history
  • Loading branch information
brandon-b-miller committed Nov 20, 2023
2 parents c56e3f4 + 3ef13d0 commit d9e4d46
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 3 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
2 changes: 1 addition & 1 deletion docs/cudf/source/user_guide/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ dtype: struct
StructDtype({'a': dtype('int64'), 'b': dtype('int64')})
```

Or by reading them from disk, using a [file format that supports nested data](io).
Or by reading them from disk, using a [file format that supports nested data](/user_guide/io/index.md).

```python
>>> pdf = pd.DataFrame({"a": [[1, 2], [3, 4, 5], [6, 7, 8]]})
Expand Down

0 comments on commit d9e4d46

Please sign in to comment.