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

Method scan_queries

benchmarks/src/benchmark_runner/suite.rs:151–177  ·  view source on GitHub ↗

Performs uncached query discovery and duplicate-id validation.

(&self)

Source from the content-addressed store, hash-verified

149
150 /// Performs uncached query discovery and duplicate-id validation.
151 fn scan_queries(&self) -> Result<Vec<SuiteQuery>> {
152 let mut queries = Vec::new();
153
154 self.scan_query_dir(self.query_search_root(), &mut queries)?;
155 queries.sort_by(|left, right| {
156 left.id
157 .cmp(&right.id)
158 .then_with(|| left.path.cmp(&right.path))
159 });
160
161 for pair in queries.windows(2) {
162 let [left, right] = pair else {
163 continue;
164 };
165 if left.id == right.id {
166 return Err(DataFusionError::Configuration(format!(
167 "duplicate QUERY_ID {} in suite '{}': {} and {}",
168 left.id,
169 self.name,
170 left.path.display(),
171 right.path.display()
172 )));
173 }
174 }
175
176 Ok(queries)
177 }
178
179 /// Recursively scans a directory and appends valid query benchmark files to
180 /// the provided collection.

Callers 1

discover_queriesMethod · 0.80

Calls 5

newFunction · 0.85
scan_query_dirMethod · 0.80
query_search_rootMethod · 0.80
sort_byMethod · 0.45
cmpMethod · 0.45

Tested by

no test coverage detected