Skip to content

Commit

Permalink
Minor: Add examples for ColumnPath::from (#5813)
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb committed May 29, 2024
1 parent 9828bf0 commit c6d089b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions parquet/src/schema/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down

0 comments on commit c6d089b

Please sign in to comment.