Skip to content

Commit

Permalink
feat: initial support string_view and binary_view, supports layout an…
Browse files Browse the repository at this point in the history
…d basic construction + tests (#5481)

* support string_view and binary_view

* fix reviewer comments
  • Loading branch information
ariesdevil authored Mar 14, 2024
1 parent ad3b4c9 commit d39cf28
Show file tree
Hide file tree
Showing 16 changed files with 1,244 additions and 112 deletions.
6 changes: 3 additions & 3 deletions arrow-array/src/array/byte_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub struct GenericByteArray<T: ByteArrayType> {
impl<T: ByteArrayType> Clone for GenericByteArray<T> {
fn clone(&self) -> Self {
Self {
data_type: self.data_type.clone(),
data_type: T::DATA_TYPE,
value_offsets: self.value_offsets.clone(),
value_data: self.value_data.clone(),
nulls: self.nulls.clone(),
Expand Down Expand Up @@ -323,7 +323,7 @@ impl<T: ByteArrayType> GenericByteArray<T> {
/// Returns a zero-copy slice of this array with the indicated offset and length.
pub fn slice(&self, offset: usize, length: usize) -> Self {
Self {
data_type: self.data_type.clone(),
data_type: T::DATA_TYPE,
value_offsets: self.value_offsets.slice(offset, length),
value_data: self.value_data.clone(),
nulls: self.nulls.as_ref().map(|n| n.slice(offset, length)),
Expand Down Expand Up @@ -511,7 +511,7 @@ impl<T: ByteArrayType> From<ArrayData> for GenericByteArray<T> {
Self {
value_offsets,
value_data,
data_type: data.data_type().clone(),
data_type: T::DATA_TYPE,
nulls: data.nulls().cloned(),
}
}
Expand Down
Loading

0 comments on commit d39cf28

Please sign in to comment.