Skip to content

Apache DataFusion SQL Query Engine

ARROW-8959: [Rust] Update benchmark to use new API (fixes broken build)

Andy Groved31d4bc0c7ac
diff --git a/rust/benchmarks/src/main.rs b/rust/benchmarks/src/main.rs
index d69ffabc45..eec58ca483 100644
--- a/rust/benchmarks/src/main.rs
+++ b/rust/benchmarks/src/main.rs
@@ -27,6 +27,7 @@ use arrow::util::pretty;
use datafusion::error::Result;
use datafusion::execution::context::ExecutionContext;
+use datafusion::execution::physical_plan::csv::CsvReadOptions;
use structopt::StructOpt;
#[derive(Debug, StructOpt)]
@@ -62,7 +63,11 @@ fn main() -> Result<()> {
let path = opt.path.to_str().unwrap();
match opt.file_format.as_str() {
- "csv" => ctx.register_csv("tripdata", path, &nyctaxi_schema(), true),
+ "csv" => {
+ let schema = nyctaxi_schema();
+ let options = CsvReadOptions::new().schema(&schema).has_header(true);
+ ctx.register_csv("tripdata", path, options)?
+ }
"parquet" => ctx.register_parquet("tripdata", path)?,
other => {
println!("Invalid file format '{}'", other);