Skip to content

Commit c37f5a0

Browse files
authored
Minor: Add examples to ProjectionMask documentation (#7523)
1 parent 7bab215 commit c37f5a0

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

parquet/src/arrow/mod.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,25 @@ pub const PARQUET_FIELD_ID_META_KEY: &str = "PARQUET:field_id";
251251
///
252252
#[derive(Debug, Clone, PartialEq, Eq)]
253253
pub struct ProjectionMask {
254-
/// If present a leaf column should be included if the value at
254+
/// If `Some`, a leaf column should be included if the value at
255255
/// the corresponding index is true
256256
///
257-
/// If `None`, include all columns
257+
/// If `None`, all columns should be included
258+
///
259+
/// # Examples
260+
///
261+
/// Given the original parquet schema with leaf columns is `[a, b, c, d]`
262+
///
263+
/// A mask of `[true, false, true, false]` will result in a schema 2
264+
/// elements long:
265+
/// * `fields[0]`: `a`
266+
/// * `fields[1]`: `c`
267+
///
268+
/// A mask of `None` will result in a schema 4 elements long:
269+
/// * `fields[0]`: `a`
270+
/// * `fields[1]`: `b`
271+
/// * `fields[2]`: `c`
272+
/// * `fields[3]`: `d`
258273
mask: Option<Vec<bool>>,
259274
}
260275

0 commit comments

Comments
 (0)