Struct datafusion::datasource::file_format::csv::CsvFormat
source · pub struct CsvFormat { /* private fields */ }
Expand description
Character Separated Value FileFormat
implementation.
Implementations§
source§impl CsvFormat
impl CsvFormat
sourcepub fn with_schema_infer_max_rec(self, max_rec: Option<usize>) -> Self
pub fn with_schema_infer_max_rec(self, max_rec: Option<usize>) -> Self
Set a limit in terms of records to scan to infer the schema
- default to
DEFAULT_SCHEMA_INFER_MAX_RECORD
sourcepub fn with_has_header(self, has_header: bool) -> Self
pub fn with_has_header(self, has_header: bool) -> Self
Set true to indicate that the first line is a header.
- default to true
sourcepub fn has_header(&self) -> bool
pub fn has_header(&self) -> bool
True if the first line is a header.
sourcepub fn with_delimiter(self, delimiter: u8) -> Self
pub fn with_delimiter(self, delimiter: u8) -> Self
The character separating values within a row.
- default to ‘,’
sourcepub fn with_file_compression_type(
self,
file_compression_type: FileCompressionType
) -> Self
pub fn with_file_compression_type( self, file_compression_type: FileCompressionType ) -> Self
Set a FileCompressionType
of CSV
- defaults to
FileCompressionType::UNCOMPRESSED
Trait Implementations§
source§impl FileFormat for CsvFormat
impl FileFormat for CsvFormat
source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Returns the table provider as
Any
so that it can be
downcast to a specific implementation.source§fn infer_schema<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_state: &'life1 SessionState,
store: &'life2 Arc<dyn ObjectStore>,
objects: &'life3 [ObjectMeta]
) -> Pin<Box<dyn Future<Output = Result<SchemaRef>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn infer_schema<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _state: &'life1 SessionState, store: &'life2 Arc<dyn ObjectStore>, objects: &'life3 [ObjectMeta] ) -> Pin<Box<dyn Future<Output = Result<SchemaRef>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,
Infer the common schema of the provided objects. The objects will usually
be analysed up to a given number of records or files (as specified in the
format config) then give the estimated common schema. This might fail if
the files have schemas that cannot be merged.
source§fn infer_stats<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_state: &'life1 SessionState,
_store: &'life2 Arc<dyn ObjectStore>,
_table_schema: SchemaRef,
_object: &'life3 ObjectMeta
) -> Pin<Box<dyn Future<Output = Result<Statistics>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn infer_stats<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, _state: &'life1 SessionState, _store: &'life2 Arc<dyn ObjectStore>, _table_schema: SchemaRef, _object: &'life3 ObjectMeta ) -> Pin<Box<dyn Future<Output = Result<Statistics>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,
Infer the statistics for the provided object. The cost and accuracy of the
estimated statistics might vary greatly between file formats. Read more
source§fn create_physical_plan<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
_state: &'life1 SessionState,
conf: FileScanConfig,
_filters: Option<&'life2 Arc<dyn PhysicalExpr>>
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ExecutionPlan>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_physical_plan<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _state: &'life1 SessionState, conf: FileScanConfig, _filters: Option<&'life2 Arc<dyn PhysicalExpr>> ) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ExecutionPlan>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
Take a list of files and convert it to the appropriate executor
according to this file format.
Auto Trait Implementations§
impl RefUnwindSafe for CsvFormat
impl Send for CsvFormat
impl Sync for CsvFormat
impl Unpin for CsvFormat
impl UnwindSafe for CsvFormat
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more