Jefffrey commented on code in PR #11625:
URL: https://github.com/apache/arrow-rs/pull/11625#discussion_r4305325627
##########
arrow-select/src/zip.rs:
##########
@@ -1748,4 +1750,83 @@ mod test {
]);
assert_eq!(actual, &expected);
}
+
+ #[test]
+ fn test_zip_kernel_scalar_strings_array_view_sliced_inline() {
+ // Both scalars are inlined, but each slice keeps its array's data
buffer
+ let truthy =
+ StringViewArray::from(vec!["x", "a string longer than twelve
bytes"]).slice(0, 1);
+ let falsy =
+ StringViewArray::from(vec!["hello", "another string longer than
twelve"]).slice(0, 1);
+
+ let mask = BooleanArray::from(vec![true, false, true, false]);
+ let out = zip(&mask, &Scalar::new(&truthy),
&Scalar::new(&falsy)).unwrap();
+ out.to_data().validate_full().unwrap();
+ let actual = out.as_string_view();
+ let expected = StringViewArray::from(vec!["x", "hello", "x", "hello"]);
+ assert_eq!(actual, &expected);
+ }
+
+ #[test]
+ fn test_zip_kernel_scalar_binary_array_view_sliced_inline_short() {
+ // A falsy value of at most 4 bytes keeps zero padding in view bytes 8
to 11
Review Comment:
why does this corruption matter for testing?
--
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]