Struct datafusion::datasource::listing::ListingTableConfig
source · [−]pub struct ListingTableConfig {
pub object_store: Arc<dyn ObjectStore>,
pub table_path: String,
pub file_schema: Option<SchemaRef>,
pub options: Option<ListingOptions>,
}
Expand description
Configuration for creating a ‘ListingTable’
Fields
object_store: Arc<dyn ObjectStore>
ObjectStore
that contains the files for the ListingTable
.
table_path: String
Path on the ObjectStore
for creating ListingTable
.
file_schema: Option<SchemaRef>
Optional SchemaRef
for the to be created ListingTable
.
options: Option<ListingOptions>
Optional ListingOptions
for the to be created ListingTable
.
Implementations
sourceimpl ListingTableConfig
impl ListingTableConfig
sourcepub fn new(
object_store: Arc<dyn ObjectStore>,
table_path: impl Into<String>
) -> Self
pub fn new(
object_store: Arc<dyn ObjectStore>,
table_path: impl Into<String>
) -> Self
Creates new ListingTableConfig
. The SchemaRef
and ListingOptions
are inferred based on the suffix of the provided table_path
.
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) -> Result<Self>
pub async fn infer_options(self) -> Result<Self>
Infer ListingOptions
based on table_path
suffix.
sourcepub async fn infer_schema(self) -> Result<Self>
pub async fn infer_schema(self) -> Result<Self>
Infer SchemaRef
based on table_path
suffix. Requires self.options
to be set prior to using.
Auto Trait Implementations
impl !RefUnwindSafe for ListingTableConfig
impl Send for ListingTableConfig
impl Sync for ListingTableConfig
impl Unpin for ListingTableConfig
impl !UnwindSafe for ListingTableConfig
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