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

Function directive_value

benchmarks/src/sql_benchmark.rs:1222–1237  ·  view source on GitHub ↗
(
    reader: &BenchmarkFileReader,
    line: &'a str,
    directive: &str,
    message: &str,
)

Source from the content-addressed store, hash-verified

1220// ---- utility function below
1221
1222fn directive_value<'a>(
1223 reader: &BenchmarkFileReader,
1224 line: &'a str,
1225 directive: &str,
1226 message: &str,
1227) -> Result<&'a str> {
1228 let value = line
1229 .get(..directive.len())
1230 .filter(|prefix| prefix.eq_ignore_ascii_case(directive))
1231 .and_then(|_| line.get(directive.len()..))
1232 .map(str::trim)
1233 .filter(|s| !s.is_empty())
1234 .ok_or_else(|| exec_datafusion_err!("{}", reader.format_exception(message)))?;
1235
1236 Ok(value)
1237}
1238
1239fn parse_group_from_path(path: &Path, benchmark_directory: &Path) -> String {
1240 let mut group_name = String::new();

Callers 1

Calls 5

filterMethod · 0.45
mapMethod · 0.45
getMethod · 0.45
lenMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…