-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Conversation
4177823
to
7a1a49e
Compare
There was a problem hiding this 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), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
7a1a49e
to
bb82a24
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
))); | ||
} | ||
} | ||
Operator::Or => { |
There was a problem hiding this comment.
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
This PR adds the binary expression to the new physical execution plan, with support for comparison operators (
<
,<=
,>
,>=
,==
,!=
) and boolean operatorsAND
andOR
.Other binary expressions, such as math expressions will be added in a future PR.