ritchie46 commented on a change in pull request #9469:
URL: https://github.com/apache/arrow/pull/9469#discussion_r574510747
##########
File path: rust/arrow/src/array/array.rs
##########
@@ -326,6 +328,141 @@ pub fn new_empty_array(data_type: &DataType) -> ArrayRef {
let data = ArrayData::new_empty(data_type);
make_array(Arc::new(data))
}
+/// Creates a new array with null slots of `length`
+pub fn new_array_with_nulls(data_type: &DataType, length: usize) -> ArrayRef {
+ let null_buf = Buffer::from(vec![0u8; bit_util::ceil(length, 8)]);
Review comment:
Could something like this reduce a unnecessary copy?
```rust
let null_buff = MutableBuffer::new_null(length).into();
```
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]