Skip to content

Commit d39cf28

Browse files
authored
feat: initial support string_view and binary_view, supports layout and basic construction + tests (#5481)
* support string_view and binary_view * fix reviewer comments
1 parent ad3b4c9 commit d39cf28

File tree

16 files changed

+1244
-112
lines changed

16 files changed

+1244
-112
lines changed

arrow-array/src/array/byte_array.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ pub struct GenericByteArray<T: ByteArrayType> {
9494
impl<T: ByteArrayType> Clone for GenericByteArray<T> {
9595
fn clone(&self) -> Self {
9696
Self {
97-
data_type: self.data_type.clone(),
97+
data_type: T::DATA_TYPE,
9898
value_offsets: self.value_offsets.clone(),
9999
value_data: self.value_data.clone(),
100100
nulls: self.nulls.clone(),
@@ -323,7 +323,7 @@ impl<T: ByteArrayType> GenericByteArray<T> {
323323
/// Returns a zero-copy slice of this array with the indicated offset and length.
324324
pub fn slice(&self, offset: usize, length: usize) -> Self {
325325
Self {
326-
data_type: self.data_type.clone(),
326+
data_type: T::DATA_TYPE,
327327
value_offsets: self.value_offsets.slice(offset, length),
328328
value_data: self.value_data.clone(),
329329
nulls: self.nulls.as_ref().map(|n| n.slice(offset, length)),
@@ -511,7 +511,7 @@ impl<T: ByteArrayType> From<ArrayData> for GenericByteArray<T> {
511511
Self {
512512
value_offsets,
513513
value_data,
514-
data_type: data.data_type().clone(),
514+
data_type: T::DATA_TYPE,
515515
nulls: data.nulls().cloned(),
516516
}
517517
}

0 commit comments

Comments
 (0)