Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
add to conversion to fixedsizebinary
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Nov 22, 2021
1 parent 61c2f3c commit 93da1ff
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/array/fixed_size_binary/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,18 @@ impl FixedSizeBinaryArray {
.get_unchecked(i * self.size..(i + 1) * self.size)
}

/// Returns a new [`FixedSizeBinary`] with a different logical type.
/// This is `O(1)`.
#[inline]
pub fn to(self, data_type: DataType) -> Self {
Self {
size: self.size,
data_type,
values: self.values,
validity: self.validity,
}
}

/// Returns the size
pub fn size(&self) -> usize {
self.size
Expand Down

0 comments on commit 93da1ff

Please sign in to comment.