Skip to content

Commit

Permalink
Doctests for StringArray and LargeStringArray. (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
novemberkilo authored May 20, 2021
1 parent 087cf17 commit e18b356
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions arrow/src/array/array_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,10 +340,26 @@ impl<OffsetSize: StringOffsetSizeTrait> From<Vec<&str>>

/// An array where each element is a variable-sized sequence of bytes representing a string
/// whose maximum length (in bytes) is represented by a i32.
///
/// Example
///
/// ```
/// use arrow::array::StringArray;
/// let array = StringArray::from(vec![Some("foo"), None, Some("bar")]);
/// assert_eq!(array.value(0), "foo");
/// ```
pub type StringArray = GenericStringArray<i32>;

/// An array where each element is a variable-sized sequence of bytes representing a string
/// whose maximum length (in bytes) is represented by a i64.
///
/// Example
///
/// ```
/// use arrow::array::LargeStringArray;
/// let array = LargeStringArray::from(vec![Some("foo"), None, Some("bar")]);
/// assert_eq!(array.value(2), "bar");
/// ```
pub type LargeStringArray = GenericStringArray<i64>;

impl<T: StringOffsetSizeTrait> From<GenericListArray<T>> for GenericStringArray<T> {
Expand Down

0 comments on commit e18b356

Please sign in to comment.