-
Notifications
You must be signed in to change notification settings - Fork 173
refactor(rust/core)!: move the ffi related stuff to the new adbc_ffi package #3381
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
Conversation
mbrobbel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just some minor question/suggestions from me.
We should also add this crate to
arrow-adbc/dev/release/post-08-rust.sh
Lines 44 to 46 in dd58077
| cargo publish --all-features -p adbc_core | |
| cargo publish --all-features -p adbc_datafusion | |
| cargo publish --all-features -p adbc_snowflake |
|
|
||
| use crate::constants; | ||
|
|
||
| pub type AdbcStatusCode = u8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can't move this to the FFI crate because the TryFrom implementation has to be in this crate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could move it and provide a TryInto impl?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you guessed, I got stuck after my first attempt to move FFI_AdbcStatusCode to adbc_ffi and had to restart by moving it to another module, just like the first commit in this PR (7ff5fb5).
I believe it's better to keep this in adbc_core for the following reasons:
- To implement
TryFrom/From. - It's referenced from the
constantsmod. - This status code doesn't include FFI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just return u8 on the FFI side. We only need u8 to AdbcStatus Into. Let's not have 2 layers of conversions for an enum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I wrote in the comments below, I'm wondering if this should be placed in the constants mod since it's defined in adbc.h.
#3381 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine by me. I just don't want another layer of conversion/indirection.
paleolimbot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have much to add here...I think separating these is great!
eitsupi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you everyone for your quick comments. I'll update later.
|
|
||
| use crate::constants; | ||
|
|
||
| pub type AdbcStatusCode = u8; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you guessed, I got stuck after my first attempt to move FFI_AdbcStatusCode to adbc_ffi and had to restart by moving it to another module, just like the first commit in this PR (7ff5fb5).
I believe it's better to keep this in adbc_core for the following reasons:
- To implement
TryFrom/From. - It's referenced from the
constantsmod. - This status code doesn't include FFI.
felipecrv
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm in favor of merging this PR as it is. It's in a good state and the pending suggestions seem unrelated to the task of extracting the FFI module.
lidavidm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is reasonable as-is. I'll merge later today unless there's objections
The driver exporter has been moved from `adbc_core` to `adbc_ffi` in #3381; however, the README remains unchanged. I found this discrepancy when upgrading the `adbc_core` dependency of [SedonaDB](https://github.com/apache/sedona-db). This out-dated information also appears in https://crates.io/crates/adbc_core and made me frustrated, so I decided to submit a PR containing this very tiny fix.
Close #3106
Close #3390
Move the
adbc_core::ffimodule, except foradbc_core::ffi::constantsandadbc_core::types::FFI_AdbcStatusCode, to the new adbc_ffi package.And, also rename the two that were not moved:
adbc_core::ffi::constantstoadbc_core::constantsadbc_core::types::FFI_AdbcStatusCodetoadbc_core::error::AdbcStatusCode