(scale_factor: Option<f64>, path: &Path)
| 363 | } |
| 364 | |
| 365 | fn resolve_scale_factor(scale_factor: Option<f64>, path: &Path) -> Result<f64> { |
| 366 | let scale_factor = scale_factor |
| 367 | .or_else(|| infer_scale_factor_from_path(path)) |
| 368 | .unwrap_or(1.0); |
| 369 | |
| 370 | if scale_factor.is_finite() && scale_factor > 0.0 { |
| 371 | Ok(scale_factor) |
| 372 | } else { |
| 373 | exec_err!( |
| 374 | "Invalid TPC-H scale factor {scale_factor}. Expected a positive finite value" |
| 375 | ) |
| 376 | } |
| 377 | } |
| 378 | |
| 379 | fn infer_scale_factor_from_path(path: &Path) -> Option<f64> { |
| 380 | path.iter().find_map(|component| { |
searching dependent graphs…