appletreeisyellow commented on code in PR #6241:
URL: https://github.com/apache/arrow-rs/pull/6241#discussion_r1715809682
##########
arrow-array/src/array/byte_view_array.rs:
##########
@@ -870,4 +891,29 @@ mod tests {
check_gc(&array.slice(2, 2));
check_gc(&array.slice(3, 1));
}
+
+ #[test]
+ fn test_eq() {
+ let test_data = [
+ Some("longer than 12 bytes"),
+ None,
+ Some("short"),
+ Some("again, this is longer than 12 bytes"),
+ ];
+
+ let array1 = {
+ let mut builder =
StringViewBuilder::new().with_fixed_block_size(8);
+ test_data.into_iter().for_each(|v| builder.append_option(v));
+ builder.finish()
+ };
+ let array2 = {
+ // create a new array with the same data but different layout
+ let mut builder =
StringViewBuilder::new().with_fixed_block_size(100);
+ test_data.into_iter().for_each(|v| builder.append_option(v));
+ builder.finish()
+ };
+ assert_eq!(array1, array1.clone());
+ assert_eq!(array2, array2.clone());
+ assert_ne!(array1, array2);
Review Comment:
This makes sense to me
--
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]