Skip to content

Commit

Permalink
Minor: Log TPCH benchmark results (apache#6813)
Browse files Browse the repository at this point in the history
  • Loading branch information
alamb authored and 2010YOUY01 committed Jul 5, 2023
1 parent 85d67d8 commit 84072bf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ arrow = { workspace = true }
datafusion = { path = "../datafusion/core", version = "27.0.0" }
env_logger = "0.10"
futures = "0.3"
log = "^0.4"
mimalloc = { version = "0.1", optional = true, default-features = false }
num_cpus = "1.13.0"
parquet = { workspace = true }
Expand Down
3 changes: 3 additions & 0 deletions benchmarks/src/bin/tpch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
// under the License.

//! Benchmark derived from TPC-H. This is not an official TPC-H benchmark.
use log::info;

use arrow::util::pretty::pretty_format_batches;
use datafusion::datasource::file_format::{csv::CsvFormat, FileFormat};
use datafusion::datasource::{MemTable, TableProvider};
use datafusion::error::{DataFusionError, Result};
Expand Down Expand Up @@ -235,6 +237,7 @@ async fn benchmark_query(
let elapsed = start.elapsed(); //.as_secs_f64() * 1000.0;
let ms = elapsed.as_secs_f64() * 1000.0;
millis.push(ms);
info!("output:\n\n{}\n\n", pretty_format_batches(&result)?);
let row_count = result.iter().map(|b| b.num_rows()).sum();
println!(
"Query {query_id} iteration {i} took {ms:.1} ms and returned {row_count} rows"
Expand Down

0 comments on commit 84072bf

Please sign in to comment.