jorgecarleitao commented on a change in pull request #8842:
URL: https://github.com/apache/arrow/pull/8842#discussion_r540380327
##########
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:
Just out of curiosity, do you recommend `self.len() == json.len() &&
...` or `self.len() == json.len() & ...`? I read somewhere that Rust
short-circuits bit operators.
----------------------------------------------------------------
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]