etseidl commented on code in PR #8797:
URL: https://github.com/apache/arrow-rs/pull/8797#discussion_r2535339586


##########
parquet/src/file/metadata/options.rs:
##########
@@ -48,11 +70,70 @@ impl ParquetMetaDataOptions {
         self.schema_descr = Some(val);
     }
 
-    /// Provide a schema to use when decoding the metadata. Returns `Self` for 
chaining.
-    pub fn with_schema(mut self, val: SchemaDescPtr) -> Self {
-        self.schema_descr = Some(val);
-        self
+    // with_schema
+    add_mutator!(schema, SchemaDescPtr);
+
+    /// Returns whether to present the `encoding_stats` field of the 
`ColumnMetaData` as a
+    /// bitmask.
+    ///
+    /// See [`ColumnChunkMetaData::page_encoding_stats_mask`] for an 
explanation of why this
+    /// might be desirable.
+    ///
+    /// [`ColumnChunkMetaData::page_encoding_stats_mask`]:
+    /// crate::file::metadata::ColumnChunkMetaData::page_encoding_stats_mask
+    pub fn encoding_stats_as_mask(&self) -> bool {
+        self.encoding_stats_as_mask
+    }
+
+    /// Convert `encoding_stats` from a vector of [`PageEncodingStats`] to a 
bitmask. This can
+    /// speed up metadata decoding while still enabling some use cases served 
by the full stats.
+    ///
+    /// See [`ColumnChunkMetaData::page_encoding_stats_mask`] for more 
information.
+    ///
+    /// [`PageEncodingStats`]: crate::file::metadata::PageEncodingStats
+    /// [`ColumnChunkMetaData::page_encoding_stats_mask`]:
+    /// crate::file::metadata::ColumnChunkMetaData::page_encoding_stats_mask
+    pub fn set_encoding_stats_as_mask(&mut self, val: bool) {
+        self.encoding_stats_as_mask = val;
     }
+
+    // with_encoding_stats_as_mask
+    add_mutator!(encoding_stats_as_mask, bool);

Review Comment:
   I removed the macro and replaced the multiple setters for stats skipping 
with a policy enum



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to