@@ -61,6 +61,16 @@ pub const OPT_PARQUET_REORDER_FILTERS: &str =
61
61
pub const OPT_PARQUET_ENABLE_PAGE_INDEX : & str =
62
62
"datafusion.execution.parquet.enable_page_index" ;
63
63
64
+ /// Configuration option "datafusion.execution.parquet.pruning"
65
+ pub const OPT_PARQUET_ENABLE_PRUNING : & str = "datafusion.execution.parquet.pruning" ;
66
+
67
+ /// Configuration option "datafusion.execution.parquet.skip_metadata"
68
+ pub const OPT_PARQUET_SKIP_METADATA : & str = "datafusion.execution.parquet.skip_metadata" ;
69
+
70
+ /// Configuration option "datafusion.execution.parquet.metadata_size_hint"
71
+ pub const OPT_PARQUET_METADATA_SIZE_HINT : & str =
72
+ "datafusion.execution.parquet.metadata_size_hint" ;
73
+
64
74
/// Configuration option "datafusion.optimizer.skip_failed_rules"
65
75
pub const OPT_OPTIMIZER_SKIP_FAILED_RULES : & str =
66
76
"datafusion.optimizer.skip_failed_rules" ;
@@ -255,6 +265,29 @@ impl BuiltInConfigs {
255
265
to reduce the number of rows decoded.",
256
266
false ,
257
267
) ,
268
+ ConfigDefinition :: new_bool(
269
+ OPT_PARQUET_ENABLE_PRUNING ,
270
+ "If true, the parquet reader attempts to skip entire row groups based \
271
+ on the predicate in the query and the metadata (min/max values) stored in \
272
+ the parquet file.",
273
+ true ,
274
+ ) ,
275
+ ConfigDefinition :: new_bool(
276
+ OPT_PARQUET_SKIP_METADATA ,
277
+ "If true, the parquet reader skip the optional embedded metadata that may be in \
278
+ the file Schema. This setting can help avoid schema conflicts when querying \
279
+ multiple parquet files with schemas containing compatible types but different metadata.",
280
+ true ,
281
+ ) ,
282
+ ConfigDefinition :: new(
283
+ OPT_PARQUET_METADATA_SIZE_HINT ,
284
+ "If specified, the parquet reader will try and fetch the last `size_hint` \
285
+ bytes of the parquet file optimistically. If not specified, two read are required: \
286
+ One read to fetch the 8-byte parquet footer and \
287
+ another to fetch the metadata length encoded in the footer.",
288
+ DataType :: UInt64 ,
289
+ ScalarValue :: UInt64 ( None ) ,
290
+ ) ,
258
291
ConfigDefinition :: new_bool(
259
292
OPT_OPTIMIZER_SKIP_FAILED_RULES ,
260
293
"When set to true, the logical plan optimizer will produce warning \
@@ -424,6 +457,12 @@ impl ConfigOptions {
424
457
get_conf_value ! ( self , UInt64 , key, "u64" )
425
458
}
426
459
460
+ /// get a u64 configuration option as a usize
461
+ pub fn get_usize ( & self , key : & str ) -> Option < usize > {
462
+ let v = get_conf_value ! ( self , UInt64 , key, "usize" ) ;
463
+ v. and_then ( |v| v. try_into ( ) . ok ( ) )
464
+ }
465
+
427
466
/// get a string configuration option
428
467
pub fn get_string ( & self , key : & str ) -> Option < String > {
429
468
get_conf_value ! ( self , Utf8 , key, "string" )
0 commit comments