Skip to content

Experiment implementation for catalog builder #1231

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

liurenjie1024
Copy link
Contributor

What changes are included in this PR?

Demo implementation for catalog builder.

Are these changes tested?

UT.

@liurenjie1024 liurenjie1024 marked this pull request as draft April 21, 2025 10:35
@liurenjie1024
Copy link
Contributor Author

liurenjie1024 commented Apr 21, 2025

I also want to remove builder for catalog configs.

This was referenced Apr 25, 2025
@liurenjie1024
Copy link
Contributor Author

cc @Xuanwo I've figured out a way to keep both traits without introducing an enum, see

pub trait BoxedCatalogBuilder {

WDYT?

@liurenjie1024
Copy link
Contributor Author

cc @Fokko @sdd @Xuanwo Could you take a look at this pr to see if this is the right direction to go?

Copy link
Collaborator

@c-thiel c-thiel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liurenjie1024 thanks for the initiative!
For my understanding I first need to answer this question:
Are we sure that we need the CatalogBuilder trait? What would be its purpose?

My initial idea would be to just have different typesafe builders for different catalogs. The current CatalogBuilder trait currently contains fields that are not required for some catalogs. For example in-memory or dynamo don't even need a uri.
On the other hand we have the rest catalog that needs significantly more configurations, and I don't think we want to make those key value pairs. I would be in favor to have the interfaces as typesafe as possible.


impl RestCatalogBuilder {
/// Configures the catalog with a custom HTTP client.
pub fn with_client(&mut self, client: Client) -> &mut Self {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc @Xuanwo

@liurenjie1024
Copy link
Contributor Author

liurenjie1024 commented May 26, 2025

Are we sure that we need the CatalogBuilder trait? What would be its purpose?

Hi, @c-thiel Sorry for misclarification. For more background, please refer to #1228. In short, we are trying to develop a catalog loader so that it can be used by some applications such as iceberg-playground or data driven integration test framework.

My initial idea would be to just have different typesafe builders for different catalogs. The current CatalogBuilder trait currently contains fields that are not required for some catalogs. For example in-memory or dynamo don't even need a uri.

I've refined the trait definition as proposed by @Xuanwo in #1372 .

On the other hand we have the rest catalog that needs significantly more configurations, and I don't think we want to make those key value pairs. I would be in favor to have the interfaces as typesafe as possible.

I think a pure type safe approach may not be practical since we also need to pass file io's configurations through catalog, and the actual file io used is determined at runtime.

As a compromise, we could define a config struct for each catalog like following:

struct RestCatalogConfig {
   #[serde(name = "name")]
   name: String,
  #[serde(name = "uri")]
   uri: Url,
  #[serde(name = "credential")]
   credential: String
}

impl TryFrom<HashMap<String, String>> for RestCatalogConfig {
 .....
}

WDYT?

sdd
sdd previously approved these changes May 27, 2025
@sdd
Copy link
Contributor

sdd commented May 27, 2025

Makes sense to me

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 this pull request may close these issues.

3 participants