Jefffrey commented on code in PR #11625:
URL: https://github.com/apache/arrow-rs/pull/11625#discussion_r4303427388


##########
arrow-select/src/zip.rs:
##########
@@ -814,10 +814,12 @@ impl<T: ByteViewType> ByteViewScalarImpl<T> {
                 let true_count = predicate.count_set_bits();
                 let mut buffers: Vec<Buffer> = truthy_buffers.to_vec();
 
-                // If the falsy buffers are empty, we can use the falsy view 
as it is, because the value
-                // is completely inlined. Otherwise, we have non-inlined 
values in the buffer, and we need
-                // to recalculate the falsy view
-                let view_falsy = if falsy_buffers.is_empty() {
+                // A short falsy value is stored entirely inside its view, so 
we can use the
+                // view as it is. We check the value's length rather than 
whether the scalar has
+                // buffers, because a scalar cut from a larger array can still 
have buffers
+                // even when its own value is short. A longer value lives in a 
buffer, so we
+                // need to update its view to point at that buffer's new 
position
+                let view_falsy = if (falsy_view as u32) <= MAX_INLINE_VIEW_LEN 
{

Review Comment:
   sorry github didnt render this diff right, it was meant to replace the 
original comment with the new one linenr



-- 
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]

Reply via email to