Skip to content

Commit

Permalink
test passes
Browse files Browse the repository at this point in the history
  • Loading branch information
andygrove committed Sep 7, 2019
1 parent dd3cbe6 commit 21e646f
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions rust/datafusion/src/execution/physical_plan/csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -77,19 +77,9 @@ impl CsvExec {
projection: Option<Vec<usize>>,
batch_size: usize,
) -> Result<Self> {
let projected_schema = match &projection {
Some(p) => {
let projected_fields: Vec<Field> =
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,
Expand Down

0 comments on commit 21e646f

Please sign in to comment.