MCPcopy Create free account
hub / github.com/apache/datafusion / call_with_args

Method call_with_args

datafusion/ffi/src/udtf.rs:276–295  ·  view source on GitHub ↗
(&self, args: TableFunctionArgs)

Source from the content-addressed store, hash-verified

274
275impl TableFunctionImpl for ForeignTableFunction {
276 fn call_with_args(&self, args: TableFunctionArgs) -> Result<Arc<dyn TableProvider>> {
277 let session = FFI_SessionRef::new(
278 args.session(),
279 self.0.runtime(),
280 self.0.logical_codec.clone(),
281 );
282 let codec: Arc<dyn LogicalExtensionCodec> = (&self.0.logical_codec).into();
283 let expr_list = LogicalExprList {
284 expr: serialize_exprs(args.exprs(), codec.as_ref())?,
285 };
286 let filters_serialized = expr_list.encode_to_vec().into_iter().collect();
287
288 let table_provider =
289 unsafe { (self.0.call_with_args)(&self.0, filters_serialized, session) };
290
291 let table_provider = df_result!(table_provider)?;
292 let table_provider: Arc<dyn TableProvider> = (&table_provider).into();
293
294 Ok(table_provider)
295 }
296
297 fn call(&self, args: &[datafusion_expr::Expr]) -> Result<Arc<dyn TableProvider>> {
298 let codec: Arc<dyn LogicalExtensionCodec> = (&self.0.logical_codec).into();

Callers 1

test_round_trip_udtfFunction · 0.45

Calls 15

newFunction · 0.85
serialize_exprsFunction · 0.85
sessionMethod · 0.80
exprsMethod · 0.80
collectMethod · 0.80
sliceMethod · 0.80
runtimeMethod · 0.45
cloneMethod · 0.45
intoMethod · 0.45
as_refMethod · 0.45
into_iterMethod · 0.45
mapMethod · 0.45

Tested by 1

test_round_trip_udtfFunction · 0.36