HaoYang670 commented on a change in pull request #1195:
URL: https://github.com/apache/arrow-rs/pull/1195#discussion_r787727815
##########
File path: arrow/src/compute/kernels/comparison.rs
##########
@@ -2794,6 +2890,177 @@ mod tests {
);
}
+ macro_rules! test_binary {
+ ($test_name:ident, $left:expr, $right:expr, $op:expr, $expected:expr)
=> {
+ #[test]
+ fn $test_name() {
+ let left = BinaryArray::from_vec($left);
+ let right = BinaryArray::from_vec($right);
+ let res = $op(&left, &right).unwrap();
+ let expected = $expected;
+ assert_eq!(expected.len(), res.len());
+ for i in 0..res.len() {
+ let v = res.value(i);
+ assert_eq!(v, expected[i]);
+ }
+
+ let left = LargeBinaryArray::from_vec($left);
+ let right = LargeBinaryArray::from_vec($right);
+ let res = $op(&left, &right).unwrap();
+ let expected = $expected;
+ assert_eq!(expected.len(), res.len());
+ for i in 0..res.len() {
+ let v = res.value(i);
+ assert_eq!(v, expected[i]);
+ }
+ }
+ };
+ }
+
Review comment:
Thank you for your advice @tustvold. I'd like to do a follow-on PR which
I will add non-utf8 tests and also add dynamic dispatched comparisons.
--
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]