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

Method run

benchmarks/src/hj.rs:309–385  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

307
308impl RunOpt {
309 pub async fn run(self) -> Result<()> {
310 println!("Running Hash Join benchmarks with the following options: {self:#?}\n");
311
312 let query_range = match self.query {
313 Some(query_id) => {
314 if query_id >= 1 && query_id <= HASH_QUERIES.len() {
315 query_id..=query_id
316 } else {
317 return exec_err!(
318 "Query {query_id} not found. Available queries: 1 to {}",
319 HASH_QUERIES.len()
320 );
321 }
322 }
323 None => 1..=HASH_QUERIES.len(),
324 };
325
326 let config = self.common.config()?;
327 let rt = self.common.build_runtime()?;
328 let ctx = SessionContext::new_with_config_rt(config, rt);
329
330 if let Some(path) = &self.path {
331 for table in &["lineitem", "supplier", "nation", "customer"] {
332 let table_path = path.join(table);
333 if !table_path.exists() {
334 return exec_err!(
335 "TPC-H table {} not found at {:?}",
336 table,
337 table_path
338 );
339 }
340 ctx.register_parquet(
341 *table,
342 table_path.to_str().unwrap(),
343 Default::default(),
344 )
345 .await?;
346 }
347 }
348
349 let mut benchmark_run = BenchmarkRun::new();
350
351 for query_id in query_range {
352 let query_index = query_id - 1;
353 let query = &HASH_QUERIES[query_index];
354
355 let case_name = format!(
356 "Query {}_density={}_prob_hit={}_{}*{}",
357 query_id,
358 query.density,
359 query.prob_hit,
360 query.build_size,
361 query.probe_size
362 );
363 benchmark_run.start_new_case(&case_name);
364
365 let query_run = self
366 .benchmark_query(query.sql, &query_id.to_string(), &ctx)

Callers 5

timed_runFunction · 0.45
cargo_cleanFunction · 0.45
run_benchmarkFunction · 0.45
handle_runFunction · 0.45
handle_verifyFunction · 0.45

Calls 14

newFunction · 0.85
build_runtimeMethod · 0.80
existsMethod · 0.80
start_new_caseMethod · 0.80
write_iterMethod · 0.80
maybe_write_jsonMethod · 0.80
ContextClass · 0.50
lenMethod · 0.45
configMethod · 0.45
joinMethod · 0.45
register_parquetMethod · 0.45
benchmark_queryMethod · 0.45

Tested by

no test coverage detected