comphead commented on code in PR #6001:
URL: https://github.com/apache/arrow-rs/pull/6001#discussion_r1668933152
##########
arrow-schema/src/schema.rs:
##########
@@ -324,11 +324,53 @@ impl Schema {
}
/// Returns a vector with references to all fields (including nested
fields)
+ ///
+ /// # Example
+ ///
+ /// ```
+ /// use std::sync::Arc;
+ /// use arrow_schema::{DataType, Field, Fields, Schema};
+ ///
+ /// let f1 = Arc::new(Field::new("a", DataType::Boolean, false));
+ ///
+ /// let f2_inner = Arc::new(Field::new("b_inner", DataType::Int8, false));
+ /// let f2 = Arc::new(Field::new("b", DataType::List(f2_inner.clone()),
false));
+ ///
+ /// let f3_inner1 = Arc::new(Field::new("c_inner1", DataType::Int8,
false));
+ /// let f3_inner2 = Arc::new(Field::new("c_inner2", DataType::Int8,
false));
+ /// let f3 = Arc::new(Field::new(
+ /// "c",
+ /// DataType::Struct(vec![f3_inner1.clone(),
f3_inner2.clone()].into()),
+ /// false
+ /// ));
+ ///
+ /// let mut schema = Schema::new(vec![
+ /// f1.clone(), f2.clone(), f3.clone()
+ /// ]);
Review Comment:
👍
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]