iceberg-rust icon indicating copy to clipboard operation
iceberg-rust copied to clipboard

refactor: Remove `async_trait` in `Catalog` trait.

Open liurenjie1024 opened this issue 2 years ago • 2 comments

After #140 get merged, we will be able to use async fn in trait, and async_trait macro is no longer needed.

liurenjie1024 avatar Dec 29 '23 06:12 liurenjie1024

Could I work on this ? Please tell me what precisely is to be done here?

hiirrxnn avatar Jan 22 '24 10:01 hiirrxnn

Could I work on this ? Please tell me what precisely is to be done here?

The release of rust 1.75 enables a fancy feature so that we no longer need to use async_trait macro, you can read this blog for reference.

You can also see the FileWriter trait in this pr as an example.

liurenjie1024 avatar Jan 23 '24 01:01 liurenjie1024

Is there any movement on this one? I see there was a prior PR to close, but it was closed pending upstream releases.

If there's nobody working on it anymore, I would like to take a shot at it if that's okay :+1:

For mine/anyone else's reference, is there a preference to using impl Future<Output = ...> or maintaining the async fn signatures with trait_variant crate?

jdockerty avatar Jun 01 '24 16:06 jdockerty

Is there any movement on this one? I see there was a prior PR to close, but it was closed pending upstream releases.

If there's nobody working on it anymore, I would like to take a shot at it if that's okay 👍

For mine/anyone else's reference, is there a preference to using impl Future<Output = ...> or maintaining the async fn signatures with trait_variant crate?

Hi, @jdockerty Thanks for you interest, I think we can go on this work after https://github.com/rust-lang/impl-trait-utils/pull/27 is release on new rust release.

liurenjie1024 avatar Jun 02 '24 02:06 liurenjie1024

I personally do not favor adopting async in trait for the Catalog API because it compromises object safety. Users will no longer be able to use Box<dyn Catalog>. All APIs related to Catalog should include generic parameters.

Xuanwo avatar Jun 10 '24 13:06 Xuanwo

I propose closing this issue as it's unlikely we'll remove async_trait from Catalog until easier methods for implementing object-safe trait objects are available. Additionally, catalog API calls are usually not on the critical path in most of our use cases. Adding such a maintenance burden isn't worth it.

cc @liurenjie1024 @jdockerty

Xuanwo avatar Jul 05 '24 15:07 Xuanwo

+1, we can close this first.

liurenjie1024 avatar Jul 06 '24 08:07 liurenjie1024