You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ag...@apache.org on 2020/05/27 01:26:08 UTC

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

This is an automated email from the ASF dual-hosted git repository.

agrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new e957b87  ARROW-8959: [Rust] Update benchmark to use new API (fixes broken build)
e957b87 is described below

commit e957b8797933c08b5205eea18570e8e09a0d7546
Author: Andy Grove <an...@gmail.com>
AuthorDate: Tue May 26 19:25:35 2020 -0600

    ARROW-8959: [Rust] Update benchmark to use new API (fixes broken build)
    
    Update benchmark to use new API (fixes broken build)
    
    Closes #7283 from andygrove/fix-rust-build
    
    Authored-by: Andy Grove <an...@gmail.com>
    Signed-off-by: Andy Grove <an...@gmail.com>
---
 rust/benchmarks/src/main.rs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/rust/benchmarks/src/main.rs b/rust/benchmarks/src/main.rs
index d69ffab..eec58ca 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);