This is an automated email from the ASF dual-hosted git repository.
dheres pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new e18b356 Doctests for StringArray and LargeStringArray. (#330)
e18b356 is described below
commit e18b356b1310d5b178f7b6290993b920d3fe7edd
Author: Navin <[email protected]>
AuthorDate: Fri May 21 01:40:05 2021 +1000
Doctests for StringArray and LargeStringArray. (#330)
---
arrow/src/array/array_string.rs | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/arrow/src/array/array_string.rs b/arrow/src/array/array_string.rs
index 0519148..8b0ad10 100644
--- a/arrow/src/array/array_string.rs
+++ b/arrow/src/array/array_string.rs
@@ -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> {