wjones127 commented on code in PR #5170:
URL: https://github.com/apache/arrow-rs/pull/5170#discussion_r1416271004


##########
arrow-select/src/take.rs:
##########
@@ -699,11 +699,13 @@ where
                 .ok_or_else(|| ArrowError::ComputeError("Cast to usize 
failed".to_string()))?;
             let start = list.value_offset(index) as <UInt32Type as 
ArrowPrimitiveType>::Native;
 
-            values.extend(start..start + length);
+            values.extend((start..start + length).map(Some));

Review Comment:
   ```suggestion
               // Safety: Range always has known length.
               unsafe {
                   values.append_trusted_len_iter(start..start + length);
               }
   ```



##########
arrow-select/src/take.rs:
##########
@@ -699,11 +699,13 @@ where
                 .ok_or_else(|| ArrowError::ComputeError("Cast to usize 
failed".to_string()))?;
             let start = list.value_offset(index) as <UInt32Type as 
ArrowPrimitiveType>::Native;
 
-            values.extend(start..start + length);
+            values.extend((start..start + length).map(Some));
+        } else {
+            values.extend((0..length).map(|_| None));

Review Comment:
   ```suggestion
               values.append_nulls(length);
   ```



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