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

Commit

Permalink
implement Default for Utf8Array (#1169)
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Jul 20, 2022
1 parent 3382559 commit dc77578
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/array/utf8/mod.rs
Expand Up @@ -590,3 +590,19 @@ unsafe impl<O: Offset> GenericBinaryArray<O> for Utf8Array<O> {
self.offsets()
}
}

impl<O: Offset> Default for Utf8Array<O> {
fn default() -> Self {
let data_type = if O::IS_LARGE {
DataType::LargeUtf8
} else {
DataType::Utf8
};
Utf8Array::new(
data_type,
vec![O::from_usize(0).unwrap()].into(),
Default::default(),
None,
)
}
}

0 comments on commit dc77578

Please sign in to comment.