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

ARROW-6669: [Rust] [DataFusion] Implement binary expression for physical plan #5478

Closed
wants to merge 5 commits into from

Conversation

andygrove
Copy link
Member

This PR adds the binary expression to the new physical execution plan, with support for comparison operators (<, <=, >, >=, ==, !=) and boolean operators AND and OR.

Other binary expressions, such as math expressions will be added in a future PR.

Copy link
Contributor

@paddyhoran paddyhoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, just one question.

Operator::GtEq => comparison_op!(left, right, gt_eq),
Operator::Eq => comparison_op!(left, right, eq),
Operator::NotEq => comparison_op!(left, right, neq),
Operator::And => boolean_op!(left, right, and),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to check that left.data_type() is boolean before using the boolean_op macro. If you pass an array with another data type though here it will downcast to a boolean array but, of course, would be incorrect.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks. I think the current code would have failed on the downcast resulting in a panic if the types were wrong (not great), and explicit checks make sense. I pushed this change and also rebased.

Copy link
Contributor

@paddyhoran paddyhoran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

)));
}
}
Operator::Or => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a shame this has to be repeated instead of using Operator::And | Operator::Or

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants