liurenjie1024 opened a new issue, #1228:
URL: https://github.com/apache/iceberg-rust/issues/1228
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:
```rust
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:
```rust
pub struct RestCatalogBuilder {
...
}
impl CatalogBuilder for RestCatalogBuilder {
....
}
```
Then we will have a catalog loader api like this:
```rust
fn load_catalog(r#type: &str) -> CatalogBuilder {
match r#type {
"rest" => RestCatalogBuilder::new()
"hive" => ....
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]