Struct datafusion::datasource::listing::ListingTable
source · [−]pub struct ListingTable { /* private fields */ }
Expand description
An implementation of TableProvider
that uses the object store
or file system listing capability to get the list of files.
Implementations
sourceimpl ListingTable
impl ListingTable
sourcepub fn try_new(config: ListingTableConfig) -> Result<Self>
pub fn try_new(config: ListingTableConfig) -> Result<Self>
Create new table that lists the FS to get the files to scan.
Takes a ListingTableConfig
as input which requires an ObjectStore
and table_path
.
ListingOptions
and SchemaRef
are optional. If they are not
provided the file type is inferred based on the file suffix.
If the schema is provided then it must be resolved before creating the table
and should contain the fields of the file without the table
partitioning columns.
sourcepub fn object_store(&self) -> &Arc<dyn ObjectStore>
pub fn object_store(&self) -> &Arc<dyn ObjectStore>
Get object store ref
sourcepub fn table_path(&self) -> &str
pub fn table_path(&self) -> &str
Get path ref
sourcepub fn options(&self) -> &ListingOptions
pub fn options(&self) -> &ListingOptions
Get options ref
Trait Implementations
sourceimpl TableProvider for ListingTable
impl TableProvider for ListingTable
sourcefn scan<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
projection: &'life1 Option<Vec<usize>>,
filters: &'life2 [Expr],
limit: Option<usize>
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ExecutionPlan>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn scan<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
projection: &'life1 Option<Vec<usize>>,
filters: &'life2 [Expr],
limit: Option<usize>
) -> Pin<Box<dyn Future<Output = Result<Arc<dyn ExecutionPlan>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Create an ExecutionPlan that will scan the table. The table provider will be usually responsible of grouping the source data into partitions that can be efficiently parallelized or distributed. Read more
sourcefn supports_filter_pushdown(
&self,
filter: &Expr
) -> Result<TableProviderFilterPushDown>
fn supports_filter_pushdown(
&self,
filter: &Expr
) -> Result<TableProviderFilterPushDown>
Tests whether the table provider can make use of a filter expression to optimise data retrieval. Read more
sourcefn table_type(&self) -> TableType
fn table_type(&self) -> TableType
Get the type of this table for metadata/catalog purposes.
Auto Trait Implementations
impl !RefUnwindSafe for ListingTable
impl Send for ListingTable
impl Sync for ListingTable
impl Unpin for ListingTable
impl !UnwindSafe for ListingTable
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