Dandandan commented on a change in pull request #822:
URL: https://github.com/apache/arrow-rs/pull/822#discussion_r725513714



##########
File path: arrow/benches/array_from_vec.rs
##########
@@ -31,9 +31,11 @@ fn array_from_vec(n: usize) {
     for i in 0..n {
         v.push((i & 0xffff) as u8);
     }
-    let arr_data = ArrayDataBuilder::new(DataType::Int32)
-        .add_buffer(Buffer::from(v))
-        .build();
+    let arr_data = unsafe {

Review comment:
       We should add a safety note here?

##########
File path: arrow/src/array/array.rs
##########
@@ -414,15 +416,17 @@ pub fn new_null_array(data_type: &DataType, length: 
usize) -> ArrayRef {
                 new_null_sized_array::<IntervalDayTimeType>(data_type, length)
             }
         },
-        DataType::FixedSizeBinary(value_len) => make_array(ArrayData::new(
-            data_type.clone(),
-            length,
-            Some(length),
-            Some(MutableBuffer::new_null(length).into()),
-            0,
-            vec![Buffer::from(vec![0u8; *value_len as usize * length])],
-            vec![],
-        )),
+        DataType::FixedSizeBinary(value_len) => make_array(unsafe {

Review comment:
       Here too.




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