Skip to content

Commit c6d089b

Browse files
authored
Minor: Add examples for ColumnPath::from (#5813)
1 parent 9828bf0 commit c6d089b

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

parquet/src/schema/types.rs

+17
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,23 @@ impl BasicTypeInfo {
665665
// Parquet descriptor definitions
666666

667667
/// Represents the location of a column in a Parquet schema
668+
///
669+
/// # Example: refer to column named `'my_column'`
670+
/// ```
671+
/// # use parquet::schema::types::ColumnPath;
672+
/// let column_path = ColumnPath::from("my_column");
673+
/// ```
674+
///
675+
/// # Example: refer to column named `c` in a nested struct `{a: {b: {c: ...}}}`
676+
/// ```
677+
/// # use parquet::schema::types::ColumnPath;
678+
/// // form path 'a.b.c'
679+
/// let column_path = ColumnPath::from(vec![
680+
/// String::from("a"),
681+
/// String::from("b"),
682+
/// String::from("c")
683+
/// ]);
684+
/// ```
668685
#[derive(Clone, PartialEq, Debug, Eq, Hash)]
669686
pub struct ColumnPath {
670687
parts: Vec<String>,

0 commit comments

Comments
 (0)