This is an automated email from the ASF dual-hosted git repository.
alamb pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/main by this push:
new c37f5a03ee Minor: Add examples to ProjectionMask documentation (#7523)
c37f5a03ee is described below
commit c37f5a03eed902759d0912425dfab4518e299501
Author: Andrew Lamb <[email protected]>
AuthorDate: Mon May 19 10:04:27 2025 -0400
Minor: Add examples to ProjectionMask documentation (#7523)
---
parquet/src/arrow/mod.rs | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/parquet/src/arrow/mod.rs b/parquet/src/arrow/mod.rs
index 76f8ef1bf0..e15a8d9b02 100644
--- a/parquet/src/arrow/mod.rs
+++ b/parquet/src/arrow/mod.rs
@@ -251,10 +251,25 @@ pub const PARQUET_FIELD_ID_META_KEY: &str =
"PARQUET:field_id";
///
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ProjectionMask {
- /// If present a leaf column should be included if the value at
+ /// If `Some`, a leaf column should be included if the value at
/// the corresponding index is true
///
- /// If `None`, include all columns
+ /// If `None`, all columns should be included
+ ///
+ /// # Examples
+ ///
+ /// Given the original parquet schema with leaf columns is `[a, b, c, d]`
+ ///
+ /// A mask of `[true, false, true, false]` will result in a schema 2
+ /// elements long:
+ /// * `fields[0]`: `a`
+ /// * `fields[1]`: `c`
+ ///
+ /// A mask of `None` will result in a schema 4 elements long:
+ /// * `fields[0]`: `a`
+ /// * `fields[1]`: `b`
+ /// * `fields[2]`: `c`
+ /// * `fields[3]`: `d`
mask: Option<Vec<bool>>,
}