Skip to content

Add catalog builder trait #1261

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

Merged
merged 7 commits into from
Jun 6, 2025
Merged

Conversation

liurenjie1024
Copy link
Contributor

Which issue does this PR close?

What changes are included in this PR?

Add CatalogBuilder trait.

Are these changes tested?

No, empty trait def.

@liurenjie1024
Copy link
Contributor Author

I tried to use object safety trait, but found a lot limitation which will make the code difficult to use, so I rollback to this version. For a more complete example, see #1231

@liurenjie1024
Copy link
Contributor Author

cc @Xuanwo @sdd @c-thiel @ZENOTME

@Xuanwo
Copy link
Member

Xuanwo commented Apr 25, 2025

I have a new proposal in #1254

/// The catalog type that this builder creates.
type C: Catalog;
/// Create a new catalog instance.
fn load(
Copy link
Member

Choose a reason for hiding this comment

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

How about simply using async fn? It's not a big thing for us to place with Send I guess.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We still need Send, otherwise this line can't be compiled.

/// Create a new catalog instance.
fn load(
self,
name: impl Into<String>,
Copy link
Member

Choose a reason for hiding this comment

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

Since name won't be a bottleneck, how about just using &str?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I still perfer to use this generic given we don't need to worry about object safety things 😄

@liurenjie1024
Copy link
Contributor Author

cc @sdd @Xuanwo @Fokko Any other concerns?

Copy link
Contributor

@sdd sdd left a comment

Choose a reason for hiding this comment

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

No concerns, this seems good to me

@liurenjie1024 liurenjie1024 merged commit e8371de into apache:main Jun 6, 2025
17 checks passed
@liurenjie1024 liurenjie1024 deleted the ray/1254 branch June 6, 2025 08:24
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.

Add CatalogBuilder trait.
3 participants