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

Method get_query

benchmarks/src/h2o.rs:216–227  ·  view source on GitHub ↗

Returns the text of query `query_id`

(&self, query_id: usize)

Source from the content-addressed store, hash-verified

214
215 /// Returns the text of query `query_id`
216 pub fn get_query(&self, query_id: usize) -> Result<&str> {
217 self.queries
218 .get(query_id - 1)
219 .ok_or_else(|| {
220 let min_id = self.min_query_id();
221 let max_id = self.max_query_id();
222 exec_datafusion_err!(
223 "Invalid query id {query_id}. Must be between {min_id} and {max_id}"
224 )
225 })
226 .map(|s| s.as_str())
227 }
228
229 pub fn min_query_id(&self) -> usize {
230 1

Callers 1

runMethod · 0.80

Calls 5

min_query_idMethod · 0.80
max_query_idMethod · 0.80
mapMethod · 0.45
getMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected