Eyad3skr commented on code in PR #9411:
URL: https://github.com/apache/arrow-rs/pull/9411#discussion_r2834859760
##########
arrow-string/src/substring.rs:
##########
@@ -356,15 +355,13 @@ fn fixed_size_binary_substring(
let mut nulls = array
.nulls()
.map(|n| n.inner().sliced())
- .map(|b| NullBuffer::new(BooleanBuffer::new(b, 0, num_of_elements)))
- .filter(|n| n.null_count() > 0);
+ .and_then(|b| NullBuffer::from_unsliced_buffer(b, num_of_elements));
+
+ // FixedSizeBinaryArray with size 0 requires a validity bitmap
if new_len == 0 && nulls.is_none() {
- // FixedSizeBinaryArray::new takes length from the values buffer,
except when size == 0.
- // In that case it uses the null buffer length, so preserve the
original length here.
- // Example: ["", "", ""] -> substring(..., 1, Some(2)) should keep
len=3;
- // otherwise it collapses to an empty array (len=0).
Review Comment:
On it!
--
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]