viirya commented on code in PR #2157:
URL: https://github.com/apache/arrow-rs/pull/2157#discussion_r928452024
##########
arrow/src/compute/kernels/comparison.rs:
##########
@@ -1964,6 +1838,195 @@ macro_rules! typed_cmp {
}};
}
+fn eq_typed_compares(left: &dyn Array, right: &dyn Array) ->
Result<BooleanArray> {
+ match (left.data_type(), left.data_type()) {
+ (DataType::Boolean, DataType::Boolean) => compare_op(
+ left.as_any().downcast_ref::<BooleanArray>().unwrap(),
+ right.as_any().downcast_ref::<BooleanArray>().unwrap(),
+ |a, b| !(a ^ b),
+ ),
+ (DataType::Int8, DataType::Int8) => compare_op(
+ left.as_any().downcast_ref::<Int8Array>().unwrap(),
+ right.as_any().downcast_ref::<Int8Array>().unwrap(),
+ |a, b| a == b,
+ ),
Review Comment:
But for some macros which we match array types, seems it doesn't reduce too
much duplication, as we still need to match particular array type (which
implements ArrayAccessor).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]