refactor(rust/core)!: move the ffi related stuff to the new adbc_ffi package#3381
Conversation
mbrobbel
left a comment
There was a problem hiding this comment.
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
|
|
||
| use crate::constants; | ||
|
|
||
| pub type AdbcStatusCode = u8; |
There was a problem hiding this comment.
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.
We could move it and provide a TryInto impl?
There was a problem hiding this comment.
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.
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.
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.
Fine by me. I just don't want another layer of conversion/indirection.
paleolimbot
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
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