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_options(self, options: CsvOptions) -> Self
pub fn with_options(self, options: CsvOptions) -> Self
Set the csv options
sourcepub fn options(&self) -> &CsvOptions
pub fn options(&self) -> &CsvOptions
Retrieve the csv options
sourcepub fn with_schema_infer_max_rec(self, max_rec: usize) -> Self
pub fn with_schema_infer_max_rec(self, max_rec: 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_quote(self, quote: u8) -> Self
pub fn with_quote(self, quote: u8) -> Self
The quote character in a row.
- default to ‘“’
sourcepub fn with_escape(self, escape: Option<u8>) -> Self
pub fn with_escape(self, escape: Option<u8>) -> Self
The escape character in a row.
- default is None
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.
source§fn create_writer_physical_plan<'life0, 'life1, 'async_trait>(
&'life0 self,
input: Arc<dyn ExecutionPlan>,
_state: &'life1 SessionState,
conf: FileSinkConfig,
order_requirements: Option<Vec<PhysicalSortRequirement>>
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ExecutionPlan>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_writer_physical_plan<'life0, 'life1, 'async_trait>(
&'life0 self,
input: Arc<dyn ExecutionPlan>,
_state: &'life1 SessionState,
conf: FileSinkConfig,
order_requirements: Option<Vec<PhysicalSortRequirement>>
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ExecutionPlan>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Take a list of files and the configuration to convert it to the
appropriate writer executor according to this file format.
Auto Trait Implementations§
impl Freeze for CsvFormat
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more