(
&self,
query: &DictionaryQuery,
ctx: &SessionContext,
)
| 359 | } |
| 360 | |
| 361 | async fn benchmark_query( |
| 362 | &self, |
| 363 | query: &DictionaryQuery, |
| 364 | ctx: &SessionContext, |
| 365 | ) -> Result<Vec<QueryResult>> { |
| 366 | let batch = self.make_record_batch(query)?; |
| 367 | ctx.deregister_table("test_data")?; |
| 368 | ctx.register_batch("test_data", batch)?; |
| 369 | |
| 370 | let mut query_results = vec![]; |
| 371 | for i in 0..self.common.iterations { |
| 372 | let start = Instant::now(); |
| 373 | let row_count = |
| 374 | Self::execute_query_without_result_buffering(query.sql, ctx).await?; |
| 375 | let elapsed = start.elapsed(); |
| 376 | println!( |
| 377 | "Query '{}' iteration {i} returned {row_count} rows in {elapsed:?}", |
| 378 | query.name |
| 379 | ); |
| 380 | query_results.push(QueryResult { elapsed, row_count }); |
| 381 | } |
| 382 | |
| 383 | Ok(query_results) |
| 384 | } |
| 385 | |
| 386 | fn make_record_batch(&self, query: &DictionaryQuery) -> Result<RecordBatch> { |
| 387 | let size = self.num_rows; |
no test coverage detected