From 21e646f50bff3512ae84995b0fb193a7fd57fbe4 Mon Sep 17 00:00:00 2001 From: Andy Grove Date: Sat, 7 Sep 2019 15:24:31 -0600 Subject: [PATCH] test passes --- rust/datafusion/src/execution/physical_plan/csv.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/rust/datafusion/src/execution/physical_plan/csv.rs b/rust/datafusion/src/execution/physical_plan/csv.rs index c10dd3a1c5707..306718fe5c46e 100644 --- a/rust/datafusion/src/execution/physical_plan/csv.rs +++ b/rust/datafusion/src/execution/physical_plan/csv.rs @@ -25,7 +25,7 @@ use std::sync::{Arc, Mutex}; use crate::error::{ExecutionError, Result}; use crate::execution::physical_plan::{BatchIterator, ExecutionPlan, Partition}; use arrow::csv; -use arrow::datatypes::{Field, Schema}; +use arrow::datatypes::Schema; use arrow::record_batch::RecordBatch; /// Execution plan for scanning a CSV file @@ -77,19 +77,9 @@ impl CsvExec { projection: Option>, batch_size: usize, ) -> Result { - let projected_schema = match &projection { - Some(p) => { - let projected_fields: Vec = - p.iter().map(|i| schema.fields()[*i].clone()).collect(); - - Arc::new(Schema::new(projected_fields)) - } - None => schema, - }; - Ok(Self { path: path.to_string(), - schema: projected_schema, + schema, has_header, projection, batch_size,