andygrove commented on a change in pull request #7004: URL: https://github.com/apache/arrow/pull/7004#discussion_r413408241
########## File path: rust/arrow/src/array/equal.rs ########## @@ -1046,6 +1062,30 @@ impl PartialEq<FixedSizeBinaryArray> for Value { } } +impl JsonEqual for UnionArray { + fn equals_json(&self, _json: &[&Value]) -> bool { + unimplemented!() + } +} + +impl PartialEq<Value> for UnionArray { + fn eq(&self, json: &Value) -> bool { + match json { + Value::Array(json_array) => self.equals_json_values(&json_array), + _ => false, + } + } +} + +impl PartialEq<UnionArray> for Value { + fn eq(&self, arrow: &UnionArray) -> bool { + match self { Review comment: nit: these two `eq` methods are very similar, but in one, you match on `self` and then compare to the argument and in the other one, this is transposed. It would be nice to make these consistent. ---------------------------------------------------------------- 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: us...@infra.apache.org