MCPcopy Create free account
hub / github.com/apache/datafusion / resolve_scale_factor

Function resolve_scale_factor

benchmarks/src/tpch/run.rs:365–377  ·  view source on GitHub ↗
(scale_factor: Option<f64>, path: &Path)

Source from the content-addressed store, hash-verified

363}
364
365fn 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
379fn infer_scale_factor_from_path(path: &Path) -> Option<f64> {
380 path.iter().find_map(|component| {

Calls 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…