tustvold commented on code in PR #6365:
URL: https://github.com/apache/arrow-rs/pull/6365#discussion_r1750400060


##########
arrow-arith/src/arity.rs:
##########
@@ -216,15 +220,39 @@ where
     }
 
     let nulls = NullBuffer::union(a.logical_nulls().as_ref(), 
b.logical_nulls().as_ref());
+    let mut output: Vec<MaybeUninit<O::Native>> = vec![MaybeUninit::uninit(); 
a.len()];
+    let a_chunks = a.values().as_ref().chunks_exact(CHUNK_SIZE);
+    let b_chunks = b.values().as_ref().chunks_exact(CHUNK_SIZE);
+    let output_chunks = output.as_mut_slice().chunks_exact(CHUNK_SIZE);
+
+    for (output, (a_chunk, b_chunk)) in 
output_chunks.zip(a_chunks.zip(b_chunks)) {
+        let a_values: [A::Native; CHUNK_SIZE] = a_chunk.try_into().unwrap();
+        let b_values: [B::Native; CHUNK_SIZE] = b_chunk.try_into().unwrap();
+        let mut output: [MaybeUninit<O::Native>; CHUNK_SIZE] = 
output.try_into().unwrap();

Review Comment:
   Have you tried running the tests in release mode, it may be the optimiser 
doesn't "exploit" any UB when in debug mode
   
   Edit: we may also not have any tests of arrays with more than 1024 elements



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