Struct datafusion::common::config::CsvOptions
source · pub struct CsvOptions {
pub has_header: bool,
pub delimiter: u8,
pub quote: u8,
pub escape: Option<u8>,
pub compression: CompressionTypeVariant,
pub schema_infer_max_rec: usize,
pub date_format: Option<String>,
pub datetime_format: Option<String>,
pub timestamp_format: Option<String>,
pub timestamp_tz_format: Option<String>,
pub time_format: Option<String>,
pub null_value: Option<String>,
}
Expand description
Options controlling CSV format
Fields§
§has_header: bool
§delimiter: u8
§quote: u8
§escape: Option<u8>
§compression: CompressionTypeVariant
§schema_infer_max_rec: usize
§date_format: Option<String>
§datetime_format: Option<String>
§timestamp_format: Option<String>
§timestamp_tz_format: Option<String>
§time_format: Option<String>
§null_value: Option<String>
Implementations§
source§impl CsvOptions
impl CsvOptions
sourcepub fn with_compression(
self,
compression_type_variant: CompressionTypeVariant
) -> CsvOptions
pub fn with_compression( self, compression_type_variant: CompressionTypeVariant ) -> CsvOptions
Set a limit in terms of records to scan to infer the schema
- default to
DEFAULT_SCHEMA_INFER_MAX_RECORD
sourcepub fn with_schema_infer_max_rec(self, max_rec: usize) -> CsvOptions
pub fn with_schema_infer_max_rec(self, max_rec: usize) -> CsvOptions
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) -> CsvOptions
pub fn with_has_header(self, has_header: bool) -> CsvOptions
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) -> CsvOptions
pub fn with_delimiter(self, delimiter: u8) -> CsvOptions
The character separating values within a row.
- default to ‘,’
sourcepub fn with_quote(self, quote: u8) -> CsvOptions
pub fn with_quote(self, quote: u8) -> CsvOptions
The quote character in a row.
- default to ‘“’
sourcepub fn with_escape(self, escape: Option<u8>) -> CsvOptions
pub fn with_escape(self, escape: Option<u8>) -> CsvOptions
The escape character in a row.
- default is None
sourcepub fn with_file_compression_type(
self,
compression: CompressionTypeVariant
) -> CsvOptions
pub fn with_file_compression_type( self, compression: CompressionTypeVariant ) -> CsvOptions
Set a CompressionTypeVariant
of CSV
- defaults to
CompressionTypeVariant::UNCOMPRESSED
Trait Implementations§
source§impl Clone for CsvOptions
impl Clone for CsvOptions
source§fn clone(&self) -> CsvOptions
fn clone(&self) -> CsvOptions
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl ConfigField for CsvOptions
impl ConfigField for CsvOptions
source§impl Debug for CsvOptions
impl Debug for CsvOptions
source§impl Default for CsvOptions
impl Default for CsvOptions
source§fn default() -> CsvOptions
fn default() -> CsvOptions
Returns the “default value” for a type. Read more
source§impl PartialEq for CsvOptions
impl PartialEq for CsvOptions
source§fn eq(&self, other: &CsvOptions) -> bool
fn eq(&self, other: &CsvOptions) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TryFrom<&CsvOptions> for CsvWriterOptions
impl TryFrom<&CsvOptions> for CsvWriterOptions
§type Error = DataFusionError
type Error = DataFusionError
The type returned in the event of a conversion error.
source§fn try_from(value: &CsvOptions) -> Result<CsvWriterOptions, DataFusionError>
fn try_from(value: &CsvOptions) -> Result<CsvWriterOptions, DataFusionError>
Performs the conversion.
impl StructuralPartialEq for CsvOptions
Auto Trait Implementations§
impl Freeze for CsvOptions
impl RefUnwindSafe for CsvOptions
impl Send for CsvOptions
impl Sync for CsvOptions
impl Unpin for CsvOptions
impl UnwindSafe for CsvOptions
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