-
Notifications
You must be signed in to change notification settings - Fork 49
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
Explore providing a ColumnarBatch like trait #21
Comments
Adding some of my thoughts here for consideration while reading the Java code:
When I think about what this would look like in the context of an FFI bridge or something along those lines, it gets a little fuzzier for me to think of how these traits might be implemented. I'm exploring some minimal amount of code to explore this thinking without needing to commit to too much time tinkering here. |
On the FFI bridge, I think you resort to exposing a C struct, that contains a void pointer to their data plus a bunch of function pointers implementing the trait methods. Then you can implement the trait for the C struct by calling into the function pointers. Here's a vague sketch: pub trait ColumnarBatch {
fn method1(arg: ArgType) -> ReturnType;
}
#[repr(C)]
pub struct FFIColumnarBatch {
private_data: *mut c_void,
method1: ::std::option::Option<
unsafe extern "C" fn(
arg1: *mut FFIArgType,
) -> FFIReturnType,
>,
}
impl ColumnarBatch for FFIColumnarBatch {
fn method1(&self, arg: ArgType) -> ReturnType {
let ffi_arg: FFIArgType = arg.into();
let result: FFIReturnType = self.method1.unwrap()(&mut ffi_arg);
result.into()
}
} This is something I've prototyped with Arrow ADBC: https://github.com/apache/arrow-adbc/blob/75ba2cef9080b19f4d242d0a03c17db304609d85/rust/src/ffi.rs#L462-L486 |
Something to explore: There really only needs to be one |
closing as we've settled on #109 |
This issue is to capture the work of determining how feasible it would be to remove our
arrow::RecordBatch
dependency and replace it with something akin to theColumnarBatch
interface implemented in the JVM kernel implementationThe goal for this ticket is to provide an interface which would allow
default-client
to rely on anarrow::RecordBatch
implementation ofColumnarBatch
that makes sense in some form.The text was updated successfully, but these errors were encountered: