Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions arrow-array/src/array/binary_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,8 @@ where
let data_len = offsets.len() - 1;
let array_data = ArrayData::builder(Self::DATA_TYPE)
.len(data_len)
.add_buffer(Buffer::from_slice_ref(&offsets))
.add_buffer(Buffer::from_slice_ref(&values))
.add_buffer(Buffer::from_vec(offsets))
.add_buffer(Buffer::from_vec(values))
.null_bit_buffer(Some(null_buf.into()));
let array_data = unsafe { array_data.build_unchecked() };
Self::from(array_data)
Expand Down
2 changes: 1 addition & 1 deletion arrow-array/src/array/primitive_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -971,7 +971,7 @@ macro_rules! def_numeric_from_vec {
fn from(data: Vec<<$ty as ArrowPrimitiveType>::Native>) -> Self {
let array_data = ArrayData::builder($ty::DATA_TYPE)
.len(data.len())
.add_buffer(Buffer::from_slice_ref(&data));
.add_buffer(Buffer::from_vec(data));
let array_data = unsafe { array_data.build_unchecked() };
PrimitiveArray::from(array_data)
}
Expand Down
2 changes: 1 addition & 1 deletion arrow-array/src/record_batch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ mod tests {
let record_batch =
RecordBatch::try_new(Arc::new(schema), vec![Arc::new(a), Arc::new(b)])
.unwrap();
assert_eq!(record_batch.get_array_memory_size(), 672);
assert_eq!(record_batch.get_array_memory_size(), 628);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because Vec doesn't round up to a multiple of 64 bytes

}

fn check_batch(record_batch: RecordBatch, num_rows: usize) {
Expand Down
4 changes: 2 additions & 2 deletions arrow-string/src/substring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ fn binary_substring<OffsetSize: OffsetSizeTrait>(
None,
array.nulls().map(|b| b.inner().sliced()),
0,
vec![Buffer::from_slice_ref(&new_offsets), new_values.into()],
vec![Buffer::from_vec(new_offsets), new_values.into()],
vec![],
)
};
Expand Down Expand Up @@ -420,7 +420,7 @@ fn utf8_substring<OffsetSize: OffsetSizeTrait>(
None,
array.nulls().map(|b| b.inner().sliced()),
0,
vec![Buffer::from_slice_ref(&new_offsets), new_values.into()],
vec![Buffer::from_vec(new_offsets), new_values.into()],
vec![],
)
};
Expand Down