Skip to content

Add CatalogBuilder trait. #1254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
liurenjie1024 opened this issue Apr 25, 2025 · 2 comments · May be fixed by #1261
Open

Add CatalogBuilder trait. #1254

liurenjie1024 opened this issue Apr 25, 2025 · 2 comments · May be fixed by #1261

Comments

@liurenjie1024
Copy link
Contributor

No description provided.

@Xuanwo
Copy link
Member

Xuanwo commented Apr 25, 2025

For CatalogLoader trait, how about we have a CatalogConfig like:

pub struct CatalogConfig {
    name: String,
    uri: String,
    warehouse: String,
    props: HashMap<String, String>,
    ...others
}

So that our CatalogLoader just need to be like:

pub trait CatalogLoader {
    fn load(cfg: CatalogConfig) -> Result<Arc<dyn Catalog>>;
}

After this change, our loader itself is dyn compatible. Users who want to rest specific APIs can still use RestCatalogBuilder.

This change also makes it much easier for pyiceberg to connect since they can pass a CatalogConfig to rust directly without extra wrapper code.

What do you think?

@liurenjie1024 liurenjie1024 linked a pull request Apr 25, 2025 that will close this issue
@liurenjie1024
Copy link
Contributor Author

For CatalogLoader trait, how about we have a CatalogConfig like:

pub struct CatalogConfig {
name: String,
uri: String,
warehouse: String,
props: HashMap<String, String>,
...others
}
So that our CatalogLoader just need to be like:

pub trait CatalogLoader {
fn load(cfg: CatalogConfig) -> Result<Arc>;
}
After this change, our loader itself is dyn compatible. Users who want to rest specific APIs can still use RestCatalogBuilder.

This change also makes it much easier for pyiceberg to connect since they can pass a CatalogConfig to rust directly without extra wrapper code.

What do you think?

Sounds like a solution. Would you mind to create an example pr like #1231 so that we have a better understand what it would look like?

@liurenjie1024 liurenjie1024 changed the title Add CatalogLoader trait. Add CatalogBuilder trait. Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants