Struct datafusion::execution::options::CsvReadOptions
source · [−]pub struct CsvReadOptions<'a> {
pub has_header: bool,
pub delimiter: u8,
pub schema: Option<&'a Schema>,
pub schema_infer_max_records: usize,
pub file_extension: &'a str,
}
Expand description
CSV file read option
Fields
has_header: bool
Does the CSV file have a header?
If schema inference is run on a file with no headers, default column names are created.
delimiter: u8
An optional column delimiter. Defaults to b','
.
schema: Option<&'a Schema>
An optional schema representing the CSV files. If None, CSV reader will try to infer it based on data in file.
schema_infer_max_records: usize
Max number of rows to read from CSV files for schema inference if needed. Defaults to 1000.
file_extension: &'a str
File extension; only files with this extension are selected for data input. Defaults to “.csv”.
Implementations
sourceimpl<'a> CsvReadOptions<'a>
impl<'a> CsvReadOptions<'a>
sourcepub fn has_header(self, has_header: bool) -> Self
pub fn has_header(self, has_header: bool) -> Self
Configure has_header setting
sourcepub fn file_extension(self, file_extension: &'a str) -> Self
pub fn file_extension(self, file_extension: &'a str) -> Self
Specify the file extension for CSV file selection
sourcepub fn delimiter_option(self, delimiter: Option<u8>) -> Self
pub fn delimiter_option(self, delimiter: Option<u8>) -> Self
Configure delimiter setting with Option, None value will be ignored
sourcepub fn schema_infer_max_records(self, max_records: usize) -> Self
pub fn schema_infer_max_records(self, max_records: usize) -> Self
Configure number of max records to read for schema inference
sourcepub fn to_listing_options(&self, target_partitions: usize) -> ListingOptions
pub fn to_listing_options(&self, target_partitions: usize) -> ListingOptions
Helper to convert these user facing options to ListingTable
options
Trait Implementations
sourceimpl<'a> Clone for CsvReadOptions<'a>
impl<'a> Clone for CsvReadOptions<'a>
sourcefn clone(&self) -> CsvReadOptions<'a>
fn clone(&self) -> CsvReadOptions<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Default for CsvReadOptions<'a>
impl<'a> Default for CsvReadOptions<'a>
impl<'a> Copy for CsvReadOptions<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for CsvReadOptions<'a>
impl<'a> Send for CsvReadOptions<'a>
impl<'a> Sync for CsvReadOptions<'a>
impl<'a> Unpin for CsvReadOptions<'a>
impl<'a> UnwindSafe for CsvReadOptions<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more