pub struct AvroReadOptions<'a> {
pub schema: Option<&'a Schema>,
pub file_extension: &'a str,
pub table_partition_cols: Vec<(String, DataType)>,
}Expand description
Options that control the reading of AVRO files.
Note this structure is supplied when a datasource is created and
can not not vary from statement to statement. For settings that
can vary statement to statement see
ConfigOptions.
Fields§
§schema: Option<&'a Schema>The data source schema.
file_extension: &'a strFile extension; only files with this extension are selected for data input.
Defaults to FileType::AVRO.get_ext().as_str().
table_partition_cols: Vec<(String, DataType)>Partition Columns
Implementations§
Trait Implementations§
Source§impl<'a> Clone for AvroReadOptions<'a>
impl<'a> Clone for AvroReadOptions<'a>
Source§fn clone(&self) -> AvroReadOptions<'a>
fn clone(&self) -> AvroReadOptions<'a>
Returns a duplicate 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 Default for AvroReadOptions<'_>
impl Default for AvroReadOptions<'_>
Source§impl ReadOptions<'_> for AvroReadOptions<'_>
impl ReadOptions<'_> for AvroReadOptions<'_>
Source§fn to_listing_options(
&self,
config: &SessionConfig,
_table_options: TableOptions,
) -> ListingOptions
fn to_listing_options( &self, config: &SessionConfig, _table_options: TableOptions, ) -> ListingOptions
Helper to convert these user facing options to
ListingTable optionsSource§fn get_resolved_schema<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 SessionConfig,
state: SessionState,
table_path: ListingTableUrl,
) -> Pin<Box<dyn Future<Output = Result<SchemaRef>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_resolved_schema<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 SessionConfig,
state: SessionState,
table_path: ListingTableUrl,
) -> Pin<Box<dyn Future<Output = Result<SchemaRef>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Infer and resolve the schema from the files/sources provided.
Source§fn _get_resolved_schema<'life0, 'async_trait>(
&'a self,
config: &'life0 SessionConfig,
state: SessionState,
table_path: ListingTableUrl,
schema: Option<&'a Schema>,
) -> Pin<Box<dyn Future<Output = Result<SchemaRef>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
fn _get_resolved_schema<'life0, 'async_trait>(
&'a self,
config: &'life0 SessionConfig,
state: SessionState,
table_path: ListingTableUrl,
schema: Option<&'a Schema>,
) -> Pin<Box<dyn Future<Output = Result<SchemaRef>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'a: 'async_trait,
'life0: 'async_trait,
helper function to reduce repetitive code. Infers the schema from sources if not provided. Infinite data sources not supported through this function.
Auto Trait Implementations§
impl<'a> Freeze for AvroReadOptions<'a>
impl<'a> RefUnwindSafe for AvroReadOptions<'a>
impl<'a> Send for AvroReadOptions<'a>
impl<'a> Sync for AvroReadOptions<'a>
impl<'a> Unpin for AvroReadOptions<'a>
impl<'a> UnwindSafe for AvroReadOptions<'a>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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