Performs uncached query discovery and duplicate-id validation.
(&self)
| 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. |
no test coverage detected