-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Describe the bug
I'm not sure if this is intentional, but this code:
datafusion/datafusion/ffi/src/udaf/mod.rs
Lines 163 to 177 in d83a290
| unsafe extern "C" fn return_type_fn_wrapper( | |
| udaf: &FFI_AggregateUDF, | |
| arg_types: RVec<WrappedSchema>, | |
| ) -> RResult<WrappedSchema, RString> { | |
| let udaf = udaf.inner(); | |
| let arg_types = rresult_return!(rvec_wrapped_to_vec_datatype(&arg_types)); | |
| let return_type = udaf | |
| .return_type(&arg_types) | |
| .and_then(|v| FFI_ArrowSchema::try_from(v).map_err(DataFusionError::from)) | |
| .map(WrappedSchema); | |
| rresult!(return_type) | |
| } |
...triggered a failure in one of my tests because it calls return_type() instead of return_field(). I had been making the assumption that if return_field() was implemented then return_type() shouldn't be called, so I had been returning an error from that function.
I believe that the FFI schemas should be able to carry field metadata...should return_field() be called here?
To Reproduce
Implement an aggregate function that returns an extension type. I believe that when this happens, the metadata on output will be lost or the source return_type() will be called instead of the return_field() implementation.
Expected behavior
I would have expected the field information to propagate to the output.
Additional context
cc @timsaucer ...help!