Open
Description
When developing iceberg-playground
and the integration test framework, I realized that it would be convenient to have a catalog loader api. I have following design in mind:
pub trait CatalogBuilder {
type C: Catalog;
fn with_name(self, name: &str) -> Self;
fn with_uri(self, uri: &str) -> Self;
fn with_warehouse(self, warehouse: &str) -> Self;
fn with_prop(self, key: &str, value: &str) -> Self;
fn build(self) -> Result<Self::C>;
}
And we need to have all catalogs to implement this trait:
pub struct RestCatalogBuilder {
...
}
impl CatalogBuilder for RestCatalogBuilder {
....
}
impl RestCatalogBuilder {
fn with_rest_client(self, client: Client) -> Self {
...
}
}
Then we will have a catalog loader api like this:
fn load_catalog(r#type: &str) -> CatalogBuilder {
match r#type {
"rest" => RestCatalogBuilder::new()
"hive" => ....
}
}
Metadata
Metadata
Assignees
Labels
No labels