This is an automated email from the ASF dual-hosted git repository.
tustvold 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 c6d089b6a80 Minor: Add examples for ColumnPath::from (#5813)
c6d089b6a80 is described below
commit c6d089b6a801b09e3b9b240426f164fdb2a6439a
Author: Andrew Lamb <[email protected]>
AuthorDate: Wed May 29 04:04:15 2024 -0400
Minor: Add examples for ColumnPath::from (#5813)
---
parquet/src/schema/types.rs | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/parquet/src/schema/types.rs b/parquet/src/schema/types.rs
index a0cbf506f7c..fbdc0929a5a 100644
--- a/parquet/src/schema/types.rs
+++ b/parquet/src/schema/types.rs
@@ -665,6 +665,23 @@ impl BasicTypeInfo {
// Parquet descriptor definitions
/// Represents the location of a column in a Parquet schema
+///
+/// # Example: refer to column named `'my_column'`
+/// ```
+/// # use parquet::schema::types::ColumnPath;
+/// let column_path = ColumnPath::from("my_column");
+/// ```
+///
+/// # Example: refer to column named `c` in a nested struct `{a: {b: {c:
...}}}`
+/// ```
+/// # use parquet::schema::types::ColumnPath;
+/// // form path 'a.b.c'
+/// let column_path = ColumnPath::from(vec![
+/// String::from("a"),
+/// String::from("b"),
+/// String::from("c")
+/// ]);
+/// ```
#[derive(Clone, PartialEq, Debug, Eq, Hash)]
pub struct ColumnPath {
parts: Vec<String>,