Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cpp/src/binaryop/compiled/binary_ops.cu
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ void apply_sorting_struct_binary_op(mutable_column_view& out,
// Struct child column type and structure mismatches are caught within the two_table_comparator
switch (op) {
case binary_operator::EQUAL: [[fallthrough]];
case binary_operator::NULL_EQUALS: [[fallthrough]];
case binary_operator::NOT_EQUAL:
detail::apply_struct_equality_op(
out,
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/binaryop/compiled/struct_binary_ops.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ void apply_struct_equality_op(mutable_column_view& out,
PhysicalEqualityComparator comparator = {},
rmm::cuda_stream_view stream = cudf::default_stream_value)
{
CUDF_EXPECTS(op == binary_operator::EQUAL || op == binary_operator::NOT_EQUAL,
CUDF_EXPECTS(op == binary_operator::EQUAL || op == binary_operator::NOT_EQUAL ||
op == binary_operator::NULL_EQUALS,
"Unsupported operator for these types");

auto tlhs = table_view{{lhs}};
Expand Down
23 changes: 18 additions & 5 deletions java/src/main/native/src/ColumnViewJni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1318,8 +1318,15 @@ JNIEXPORT jlong JNICALL Java_ai_rapids_cudf_ColumnView_binaryOpVV(JNIEnv *env, j
cudf::binary_operator op = static_cast<cudf::binary_operator>(int_op);

if (lhs->type().id() == cudf::type_id::STRUCT) {
auto [new_mask, null_count] = cudf::bitmask_and(cudf::table_view{{*lhs, *rhs}});
auto out = make_fixed_width_column(n_data_type, lhs->size(), std::move(new_mask), null_count);
auto out = make_fixed_width_column(n_data_type, lhs->size(), cudf::mask_state::UNALLOCATED);

if (op == cudf::binary_operator::NULL_EQUALS) {
out->set_null_mask(rmm::device_buffer{}, 0);
} else {
auto [new_mask, null_count] = cudf::bitmask_and(cudf::table_view{{*lhs, *rhs}});
out->set_null_mask(std::move(new_mask), null_count);
}

auto out_view = out->mutable_view();
cudf::binops::compiled::detail::apply_sorting_struct_binary_op(out_view, *lhs, *rhs, false,
false, op);
Expand Down Expand Up @@ -1357,9 +1364,15 @@ JNIEXPORT jlong JNICALL Java_ai_rapids_cudf_ColumnView_binaryOpVS(JNIEnv *env, j
cudf::binary_operator op = static_cast<cudf::binary_operator>(int_op);

if (lhs->type().id() == cudf::type_id::STRUCT) {
auto [new_mask, new_null_count] = cudf::binops::scalar_col_valid_mask_and(*lhs, *rhs);
auto out =
make_fixed_width_column(n_data_type, lhs->size(), std::move(new_mask), new_null_count);
auto out = make_fixed_width_column(n_data_type, lhs->size(), cudf::mask_state::UNALLOCATED);

if (op == cudf::binary_operator::NULL_EQUALS) {
out->set_null_mask(rmm::device_buffer{}, 0);
} else {
auto [new_mask, new_null_count] = cudf::binops::scalar_col_valid_mask_and(*lhs, *rhs);
out->set_null_mask(std::move(new_mask), new_null_count);
}

auto rhsv = cudf::make_column_from_scalar(*rhs, 1);
auto out_view = out->mutable_view();
cudf::binops::compiled::detail::apply_sorting_struct_binary_op(out_view, *lhs, rhsv->view(),
Expand Down
12 changes: 9 additions & 3 deletions java/src/main/native/src/ScalarJni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,15 @@ JNIEXPORT jlong JNICALL Java_ai_rapids_cudf_Scalar_binaryOpSV(JNIEnv *env, jclas
cudf::binary_operator op = static_cast<cudf::binary_operator>(int_op);

if (lhs->type().id() == cudf::type_id::STRUCT) {
auto [new_mask, new_null_count] = cudf::binops::scalar_col_valid_mask_and(*rhs, *lhs);
auto out =
make_fixed_width_column(n_data_type, rhs->size(), std::move(new_mask), new_null_count);
auto out = make_fixed_width_column(n_data_type, rhs->size(), cudf::mask_state::UNALLOCATED);

if (op == cudf::binary_operator::NULL_EQUALS) {
out->set_null_mask(rmm::device_buffer{}, 0);
} else {
auto [new_mask, new_null_count] = cudf::binops::scalar_col_valid_mask_and(*rhs, *lhs);
out->set_null_mask(std::move(new_mask), new_null_count);
}

auto lhs_col = cudf::make_column_from_scalar(*lhs, 1);
auto out_view = out->mutable_view();
cudf::binops::compiled::detail::apply_sorting_struct_binary_op(out_view, lhs_col->view(),
Expand Down
Loading