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

Function parse_group_from_path

benchmarks/src/sql_benchmark.rs:1239–1260  ·  view source on GitHub ↗
(path: &Path, benchmark_directory: &Path)

Source from the content-addressed store, hash-verified

1237}
1238
1239fn parse_group_from_path(path: &Path, benchmark_directory: &Path) -> String {
1240 let mut group_name = String::new();
1241 let mut parent = path.parent();
1242
1243 while let Some(p) = parent {
1244 if path_ends_with_ignore_ascii_case(p, benchmark_directory) {
1245 break;
1246 }
1247
1248 if let Some(dir_name) = p.file_name() {
1249 group_name = dir_name.to_string_lossy().into_owned();
1250 }
1251
1252 parent = p.parent();
1253 }
1254
1255 if group_name.is_empty() {
1256 warn!("Unable to find group name in path: {}", path.display());
1257 }
1258
1259 group_name
1260}
1261
1262fn path_ends_with_ignore_ascii_case(path: &Path, suffix: &Path) -> bool {
1263 let mut path_components = path.components().rev();

Calls 3

newFunction · 0.85
is_emptyMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…