Dandandan commented on a change in pull request #8842:
URL: https://github.com/apache/arrow/pull/8842#discussion_r540385163
##########
File path: rust/arrow/src/array/equal_json.rs
##########
@@ -49,6 +49,20 @@ impl<T: ArrowPrimitiveType> JsonEqual for PrimitiveArray<T> {
}
}
+/// Implement array equals for numeric type
+impl JsonEqual for BooleanArray {
+ fn equals_json(&self, json: &[&Value]) -> bool {
+ if self.len() != json.len() {
+ return false;
+ }
+
+ (0..self.len()).all(|i| match json[i] {
Review comment:
I just thought `self.len() == json.len() &&` would read better than `if
(self.len() == json.len()) return false ` in this case.
For short-circuiting I'm not sure? I was assuming Rust short-circuits `&&`
and not `&`, that would be the "unsurprising" choice to me but I might be wrong.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]