tustvold commented on code in PR #3148:
URL: https://github.com/apache/arrow-rs/pull/3148#discussion_r1028264447
##########
arrow-schema/src/field.rs:
##########
@@ -545,10 +576,30 @@ mod test {
assert_ne!(get_field_hash(&dict1), get_field_hash(&dict2));
}
+ #[test]
+ fn test_field_comparison_metadata() {
+ let f1 = Field::new("x", DataType::Binary,
false).with_metadata(HashMap::from([
+ (String::from("k1"), String::from("v1")),
+ (String::from("k2"), String::from("v2")),
+ ]));
+ let f2 = Field::new("x", DataType::Binary,
false).with_metadata(HashMap::from([
+ (String::from("k1"), String::from("v1")),
+ (String::from("k3"), String::from("v3")),
+ ]));
+ let f3 = Field::new("x", DataType::Binary,
false).with_metadata(HashMap::from([
+ (String::from("k1"), String::from("v1")),
+ (String::from("k3"), String::from("v4")),
+ ]));
+
+ assert!(f1.cmp(&f2).is_gt());
Review Comment:
This is the wrong way round -
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=762364804fd29dea0aa91b00c0de3ff3
--
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]