Struct datafusion::datasource::listing::ListingTableConfig
source · pub struct ListingTableConfig {
pub table_paths: Vec<ListingTableUrl>,
pub file_schema: Option<SchemaRef>,
pub options: Option<ListingOptions>,
}
Expand description
Configuration for creating a ListingTable
Fields§
§table_paths: Vec<ListingTableUrl>
Paths on the ObjectStore
for creating ListingTable
.
They should share the same schema and object store.
file_schema: Option<SchemaRef>
Optional SchemaRef
for the to be created ListingTable
.
options: Option<ListingOptions>
Optional ListingOptions
for the to be created ListingTable
.
Implementations§
source§impl ListingTableConfig
impl ListingTableConfig
sourcepub fn new(table_path: ListingTableUrl) -> Self
pub fn new(table_path: ListingTableUrl) -> Self
Creates new ListingTableConfig
.
The SchemaRef
and ListingOptions
are inferred based on
the suffix of the provided table_paths
first element.
sourcepub fn new_with_multi_paths(table_paths: Vec<ListingTableUrl>) -> Self
pub fn new_with_multi_paths(table_paths: Vec<ListingTableUrl>) -> Self
Creates new ListingTableConfig
with multiple table paths.
The SchemaRef
and ListingOptions
are inferred based on
the suffix of the provided table_paths
first element.
sourcepub fn with_schema(self, schema: SchemaRef) -> Self
pub fn with_schema(self, schema: SchemaRef) -> Self
Add schema
to ListingTableConfig
sourcepub fn with_listing_options(self, listing_options: ListingOptions) -> Self
pub fn with_listing_options(self, listing_options: ListingOptions) -> Self
Add listing_options
to ListingTableConfig
sourcepub async fn infer_options(self, state: &SessionState) -> Result<Self>
pub async fn infer_options(self, state: &SessionState) -> Result<Self>
Infer ListingOptions
based on table_path
suffix.
sourcepub async fn infer_schema(self, state: &SessionState) -> Result<Self>
pub async fn infer_schema(self, state: &SessionState) -> Result<Self>
Infer the SchemaRef
based on table_path
suffix. Requires self.options
to be set prior to using.
sourcepub async fn infer(self, state: &SessionState) -> Result<Self>
pub async fn infer(self, state: &SessionState) -> Result<Self>
Convenience wrapper for calling infer_options
and infer_schema
Trait Implementations§
source§impl Clone for ListingTableConfig
impl Clone for ListingTableConfig
source§fn clone(&self) -> ListingTableConfig
fn clone(&self) -> ListingTableConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more