@@ -118,15 +118,14 @@ pub struct IndexingSettings {
118118 pub split_num_docs_target : usize ,
119119 #[ serde( default ) ]
120120 pub merge_policy : MergePolicyConfig ,
121- /// Merge policy for Parquet (metrics/sketches) splits. Controls how
122- /// Parquet splits are compacted within time windows. Only used by
123- /// indexes that use the Parquet indexing pipeline.
124- #[ serde( default ) ]
125- pub parquet_merge_policy : ParquetMergePolicyConfig ,
126- /// Parquet-specific indexing settings (sort schema, window duration,
127- /// compression). Only used by indexes that use the Parquet pipeline.
128- #[ serde( default ) ]
129- pub parquet_indexing : ParquetIndexingConfig ,
121+ /// Merge policy for Parquet (metrics/sketches) splits.
122+ #[ cfg( feature = "metrics" ) ]
123+ #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
124+ pub parquet_merge_policy : Option < ParquetMergePolicyConfig > ,
125+ /// Parquet-specific indexing settings (sort schema, window duration).
126+ #[ cfg( feature = "metrics" ) ]
127+ #[ serde( default , skip_serializing_if = "Option::is_none" ) ]
128+ pub parquet_indexing : Option < ParquetIndexingConfig > ,
130129 #[ serde( default ) ]
131130 pub resources : IndexingResources ,
132131}
@@ -147,12 +146,11 @@ pub struct ParquetIndexingConfig {
147146 /// (`__s` = string, `__i` = int64, `_secs` = uint64 timestamp).
148147 ///
149148 /// The sort order determines:
150- /// - **Query pruning**: queries that filter on leading sort columns can
151- /// skip entire splits whose row key ranges don't match.
152- /// - **Compression**: columns with good locality (e.g., metric_name first)
153- /// compress better in Parquet's columnar format.
154- /// - **Compaction scope**: splits with different sort schemas are never
155- /// merged together.
149+ /// - **Query pruning**: queries that filter on leading sort columns can skip entire splits
150+ /// whose row key ranges don't match.
151+ /// - **Compression**: columns with good locality (e.g., metric_name first) compress better in
152+ /// Parquet's columnar format.
153+ /// - **Compaction scope**: splits with different sort schemas are never merged together.
156154 ///
157155 /// When `None`, the product-type default is used (see below).
158156 ///
@@ -208,6 +206,20 @@ impl IndexingSettings {
208206 Duration :: from_secs ( self . commit_timeout_secs as u64 )
209207 }
210208
209+ /// Returns the Parquet merge policy config, using defaults if not
210+ /// explicitly configured.
211+ #[ cfg( feature = "metrics" ) ]
212+ pub fn parquet_merge_policy ( & self ) -> ParquetMergePolicyConfig {
213+ self . parquet_merge_policy . clone ( ) . unwrap_or_default ( )
214+ }
215+
216+ /// Returns the Parquet indexing config, using defaults if not
217+ /// explicitly configured.
218+ #[ cfg( feature = "metrics" ) ]
219+ pub fn parquet_indexing ( & self ) -> ParquetIndexingConfig {
220+ self . parquet_indexing . clone ( ) . unwrap_or_default ( )
221+ }
222+
211223 fn default_commit_timeout_secs ( ) -> usize {
212224 60
213225 }
@@ -241,8 +253,10 @@ impl Default for IndexingSettings {
241253 docstore_compression_level : Self :: default_docstore_compression_level ( ) ,
242254 split_num_docs_target : Self :: default_split_num_docs_target ( ) ,
243255 merge_policy : MergePolicyConfig :: default ( ) ,
244- parquet_merge_policy : ParquetMergePolicyConfig :: default ( ) ,
245- parquet_indexing : ParquetIndexingConfig :: default ( ) ,
256+ #[ cfg( feature = "metrics" ) ]
257+ parquet_merge_policy : None ,
258+ #[ cfg( feature = "metrics" ) ]
259+ parquet_indexing : None ,
246260 resources : IndexingResources :: default ( ) ,
247261 }
248262 }
0 commit comments