Apache DataFusion SQL Query Engine
ARROW-10096: [Rust] [DataFusion] Removed unused code
Jorge C. Leitaof5b8616bd1d5
diff --git a/rust/datafusion/src/datasource/csv.rs b/rust/datafusion/src/datasource/csv.rsindex 3ec19875f7..45c1fbb0b1 100644--- a/rust/datafusion/src/datasource/csv.rs+++ b/rust/datafusion/src/datasource/csv.rs@@ -33,12 +33,7 @@//! let schema = csvdata.schema();//! ```-use std::fs::File;--use arrow::csv;-use arrow::datatypes::{Field, Schema, SchemaRef};-use arrow::error::Result as ArrowResult;-use arrow::record_batch::{RecordBatch, RecordBatchReader};+use arrow::datatypes::SchemaRef;use std::string::String;use std::sync::Arc;@@ -105,57 +100,3 @@ impl TableProvider for CsvFile {)?))}}--/// Iterator over CSV batches-// TODO: usage example (rather than documenting `new()`)-pub struct CsvBatchIterator {- schema: SchemaRef,- reader: csv::Reader<File>,-}--impl CsvBatchIterator {- #[allow(missing_docs)]- pub fn try_new(- filename: &str,- schema: SchemaRef,- has_header: bool,- delimiter: Option<u8>,- projection: &Option<Vec<usize>>,- batch_size: usize,- ) -> Result<Self> {- let file = File::open(filename)?;- let reader = csv::Reader::new(- file,- schema.clone(),- has_header,- delimiter,- batch_size,- projection.clone(),- );-- 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 {- schema: projected_schema,- reader,- })- }-}--impl RecordBatchReader for CsvBatchIterator {- fn schema(&self) -> SchemaRef {- self.schema.clone()- }-- fn next_batch(&mut self) -> ArrowResult<Option<RecordBatch>> {- self.reader.next()- }-}diff --git a/rust/datafusion/src/datasource/mod.rs b/rust/datafusion/src/datasource/mod.rsindex a3f99664a5..5c3b9401be 100644--- a/rust/datafusion/src/datasource/mod.rs+++ b/rust/datafusion/src/datasource/mod.rs@@ -22,6 +22,6 @@ pub mod datasource;pub mod memory;pub mod parquet;-pub use self::csv::{CsvBatchIterator, CsvFile, CsvReadOptions};+pub use self::csv::{CsvFile, CsvReadOptions};pub use self::datasource::TableProvider;pub use self::memory::MemTable;