Commits


Ruan Pearce-Authers authored and Andrew Lamb committed 14441db1874
ARROW-12037: [Rust] [DataFusion] Support catalogs and schemas for table namespacing This is an implementation of catalog and schema providers to support table namespacing (see the [design doc](https://docs.google.com/document/d/1_bCP_tjVRLJyOrMBOezSFNpF0hwPa1ZS_qMWv1uvtS4/edit?usp=sharing)). I'm creating this draft PR as a supporting implementation for the proposal, to prove out that the work can be done whilst minimising API churn and still allowing for use cases that don't care at all about the notion of catalogs or schemas; in this new setup, the default namespace is `datafusion.public`, which will be created automatically with the default execution context config and allow for table registration. ## Highlights - Datasource map removed in execution context state, replaced with catalog map - Execution context allows for registering new catalog providers - Catalog providers can be queried for their constituent schema providers - Schema providers can be queried for table providers, similarly to the old datasource map - Includes basic implementations of `CatalogProvider` and `SchemaProvider` backed by hashmaps - New `TableReference` enum maps to various ways of referring to a table in sql - Bare: `my_table` - Partial: `schema.my_table` - Full: `catalog.schema.my_table` - Given a default catalog and schema, `TableReference` instances of any variant can be converted to a `ResolvedTableReference`, which always include all three components Closes #9762 from returnString/catalog Lead-authored-by: Ruan Pearce-Authers <ruanpa@outlook.com> Co-authored-by: Ruan Pearce-Authers <ruan@reservoirdb.com> Signed-off-by: Andrew Lamb <andrew@nerdnetworks.org>