Get the SQL statements from the specified query file
(base_query_path: &str, query: usize)
| 73 | |
| 74 | /// Get the SQL statements from the specified query file |
| 75 | pub fn get_query_sql(base_query_path: &str, query: usize) -> Result<Vec<String>> { |
| 76 | if query > 0 && query < 100 { |
| 77 | let filename = format!("{base_query_path}/{query}.sql"); |
| 78 | let mut errors = vec![]; |
| 79 | match fs::read_to_string(&filename) { |
| 80 | Ok(contents) => { |
| 81 | return Ok(contents |
| 82 | .split(';') |
| 83 | .map(|s| s.trim()) |
| 84 | .filter(|s| !s.is_empty()) |
| 85 | .map(|s| s.to_string()) |
| 86 | .collect()); |
| 87 | } |
| 88 | Err(e) => errors.push(format!("{filename}: {e}")), |
| 89 | }; |
| 90 | |
| 91 | plan_err!("invalid query. Could not find query: {:?}", errors) |
| 92 | } else { |
| 93 | plan_err!("invalid query. Expected value between 1 and 99") |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | /// Run the tpcds benchmark. |
| 98 | #[derive(Debug, Args, Clone)] |
no test coverage detected
searching dependent graphs…