Struct datafusion::catalog::listing_schema::ListingSchemaProvider
source · pub struct ListingSchemaProvider { /* private fields */ }
Expand description
A SchemaProvider
that scans an ObjectStore
to automatically discover tables
A subfolder relationship is assumed, i.e. given:
authority = s3://host.example.com:3000
path = /data/tpch
factory = DeltaTableFactory
A table called “customer” will be registered for the folder: s3://host.example.com:3000/data/tpch/customer
assuming it contains valid deltalake data, i.e: s3://host.example.com:3000/data/tpch/customer/part-00000-xxxx.snappy.parquet s3://host.example.com:3000/data/tpch/customer/_delta_log/
Implementations§
source§impl ListingSchemaProvider
impl ListingSchemaProvider
sourcepub fn new(
authority: String,
path: Path,
factory: Arc<dyn TableProviderFactory>,
store: Arc<dyn ObjectStore>,
format: String,
has_header: bool
) -> Self
pub fn new( authority: String, path: Path, factory: Arc<dyn TableProviderFactory>, store: Arc<dyn ObjectStore>, format: String, has_header: bool ) -> Self
Create a new ListingSchemaProvider
Arguments:
authority
: The scheme (i.e. s3://) + host (i.e. example.com:3000)
path
: The root path that contains subfolders which represent tables
factory
: The TableProviderFactory
to use to instantiate tables for each subfolder
store
: The ObjectStore
containing the table data
format
: The FileFormat
of the tables
has_header
: Indicates whether the created external table has the has_header flag enabled
sourcepub async fn refresh(&self, state: &SessionState) -> Result<()>
pub async fn refresh(&self, state: &SessionState) -> Result<()>
Reload table information from ObjectStore
Trait Implementations§
source§impl SchemaProvider for ListingSchemaProvider
impl SchemaProvider for ListingSchemaProvider
source§fn as_any(&self) -> &dyn Any
fn as_any(&self) -> &dyn Any
Any
so that it can be downcast to a specific implementation.