Struct datafusion::datasource::file_format::options::AvroReadOptions
source · 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 str
File 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 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<'a> Default for AvroReadOptions<'a>
impl<'a> Default for AvroReadOptions<'a>
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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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