@@ -31,6 +31,20 @@ pub struct IoxQueryDatafusionConfig {
31
31
) ]
32
32
pub max_parquet_fanout : usize ,
33
33
34
+ /// Use a cached parquet loader when reading parquet files from object store
35
+ ///
36
+ /// This reduces IO operations to a remote object store as parquet is typically read via
37
+ /// multiple read_range requests which would each require a IO operation. This will cache the
38
+ /// entire parquet file in memory and serve the read_range requests from the cached data, thus
39
+ /// requiring a single IO operation.
40
+ #[ clap(
41
+ long = "datafusion-use-cached-parquet-loader" ,
42
+ env = "INFLUXDB3_DATAFUSION_USE_CACHED_PARQUET_LOADER" ,
43
+ default_value = "true" ,
44
+ action
45
+ ) ]
46
+ pub use_cached_parquet_loader : bool ,
47
+
34
48
/// Provide custom configuration to DataFusion as a comma-separated list of key:value pairs.
35
49
///
36
50
/// # Example
@@ -64,6 +78,13 @@ impl IoxQueryDatafusionConfig {
64
78
format ! ( "{prefix}.max_parquet_fanout" , prefix = IoxConfigExt :: PREFIX ) ,
65
79
self . max_parquet_fanout . to_string ( ) ,
66
80
) ;
81
+ self . datafusion_config . insert (
82
+ format ! (
83
+ "{prefix}.use_cached_parquet_loader" ,
84
+ prefix = IoxConfigExt :: PREFIX
85
+ ) ,
86
+ self . use_cached_parquet_loader . to_string ( ) ,
87
+ ) ;
67
88
self . datafusion_config
68
89
}
69
90
}
0 commit comments