(self)
| 127 | |
| 128 | impl RunOpt { |
| 129 | pub async fn run(self) -> Result<()> { |
| 130 | println!("Running benchmarks with the following options: {self:?}"); |
| 131 | |
| 132 | let query_dir_metadata = fs::metadata(&self.queries_path).map_err(|e| { |
| 133 | if e.kind() == ErrorKind::NotFound { |
| 134 | exec_datafusion_err!( |
| 135 | "Query path '{}' does not exist.", |
| 136 | &self.queries_path.to_str().unwrap() |
| 137 | ) |
| 138 | } else { |
| 139 | DataFusionError::External(Box::new(e)) |
| 140 | } |
| 141 | })?; |
| 142 | |
| 143 | if !query_dir_metadata.is_dir() { |
| 144 | return Err(exec_datafusion_err!( |
| 145 | "Query path '{}' is not a directory.", |
| 146 | &self.queries_path.to_str().unwrap() |
| 147 | )); |
| 148 | } |
| 149 | |
| 150 | let query_range = match self.query { |
| 151 | Some(query_id) => query_id..=query_id, |
| 152 | None => 0..=usize::MAX, |
| 153 | }; |
| 154 | |
| 155 | // configure parquet options |
| 156 | let mut config = self.common.config()?; |
| 157 | |
| 158 | if self.sorted_by.is_some() { |
| 159 | println!("ℹ️ Data is registered with sort order"); |
| 160 | |
| 161 | let has_prefer_sort = self |
| 162 | .config_options |
| 163 | .iter() |
| 164 | .any(|opt| opt.contains("prefer_existing_sort=true")); |
| 165 | |
| 166 | if !has_prefer_sort { |
| 167 | println!( |
| 168 | "ℹ️ Consider using -c datafusion.optimizer.prefer_existing_sort=true" |
| 169 | ); |
| 170 | println!("ℹ️ to optimize queries while maintaining parallelism"); |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | // Apply user-provided configuration options |
| 175 | for config_opt in &self.config_options { |
| 176 | let parts: Vec<&str> = config_opt.splitn(2, '=').collect(); |
| 177 | if parts.len() != 2 { |
| 178 | return Err(exec_datafusion_err!( |
| 179 | "Invalid config option format: '{}'. Expected 'key=value'", |
| 180 | config_opt |
| 181 | )); |
| 182 | } |
| 183 | let key = parts[0]; |
| 184 | let value = parts[1]; |
| 185 | |
| 186 | println!("Setting config: {key} = {value}"); |
nothing calls this directly
no test coverage detected