coderfender commented on code in PR #21030:
URL: https://github.com/apache/datafusion/pull/21030#discussion_r2985704285
##########
datafusion/ffi/src/proto/logical_extension_codec.rs:
##########
@@ -185,86 +187,86 @@ unsafe extern "C" fn try_encode_table_provider_fn_wrapper(
&mut bytes
));
- RResult::ROk(bytes.into())
+ FfiResult::Ok(bytes.into_iter().collect())
}
unsafe extern "C" fn try_decode_udf_fn_wrapper(
codec: &FFI_LogicalExtensionCodec,
- name: RStr,
- buf: RSlice<u8>,
+ name: SStr,
+ buf: SSlice<u8>,
) -> FFIResult<FFI_ScalarUDF> {
let codec = codec.inner();
let udf = rresult_return!(codec.try_decode_udf(name.as_str(),
buf.as_ref()));
let udf = FFI_ScalarUDF::from(udf);
- RResult::ROk(udf)
+ FfiResult::Ok(udf)
}
unsafe extern "C" fn try_encode_udf_fn_wrapper(
codec: &FFI_LogicalExtensionCodec,
node: FFI_ScalarUDF,
-) -> FFIResult<RVec<u8>> {
+) -> FFIResult<SVec<u8>> {
let codec = codec.inner();
let node: Arc<dyn ScalarUDFImpl> = (&node).into();
let node = ScalarUDF::new_from_shared_impl(node);
let mut bytes = Vec::new();
rresult_return!(codec.try_encode_udf(&node, &mut bytes));
- RResult::ROk(bytes.into())
+ FfiResult::Ok(bytes.into_iter().collect())
}
unsafe extern "C" fn try_decode_udaf_fn_wrapper(
codec: &FFI_LogicalExtensionCodec,
- name: RStr,
- buf: RSlice<u8>,
+ name: SStr,
+ buf: SSlice<u8>,
) -> FFIResult<FFI_AggregateUDF> {
let codec_inner = codec.inner();
let udaf = rresult_return!(codec_inner.try_decode_udaf(name.into(),
buf.as_ref()));
let udaf = FFI_AggregateUDF::from(udaf);
- RResult::ROk(udaf)
+ FfiResult::Ok(udaf)
}
unsafe extern "C" fn try_encode_udaf_fn_wrapper(
codec: &FFI_LogicalExtensionCodec,
node: FFI_AggregateUDF,
-) -> FFIResult<RVec<u8>> {
+) -> FFIResult<SVec<u8>> {
let codec = codec.inner();
let udaf: Arc<dyn AggregateUDFImpl> = (&node).into();
let udaf = AggregateUDF::new_from_shared_impl(udaf);
let mut bytes = Vec::new();
rresult_return!(codec.try_encode_udaf(&udaf, &mut bytes));
- RResult::ROk(bytes.into())
+ FfiResult::Ok(bytes.into_iter().collect())
}
unsafe extern "C" fn try_decode_udwf_fn_wrapper(
codec: &FFI_LogicalExtensionCodec,
- name: RStr,
- buf: RSlice<u8>,
+ name: SStr,
+ buf: SSlice<u8>,
) -> FFIResult<FFI_WindowUDF> {
let codec = codec.inner();
let udwf = rresult_return!(codec.try_decode_udwf(name.into(),
buf.as_ref()));
let udwf = FFI_WindowUDF::from(udwf);
- RResult::ROk(udwf)
+ FfiResult::Ok(udwf)
}
unsafe extern "C" fn try_encode_udwf_fn_wrapper(
codec: &FFI_LogicalExtensionCodec,
node: FFI_WindowUDF,
-) -> FFIResult<RVec<u8>> {
+) -> FFIResult<SVec<u8>> {
let codec = codec.inner();
let udwf: Arc<dyn WindowUDFImpl> = (&node).into();
let udwf = WindowUDF::new_from_shared_impl(udwf);
let mut bytes = Vec::new();
rresult_return!(codec.try_encode_udwf(&udwf, &mut bytes));
- RResult::ROk(bytes.into())
+ FfiResult::Ok(bytes.into_iter().collect())
Review Comment:
Thats right. These are some subtle differences between the implementations
in abi_stable and stabby
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]