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

Method create_physical_expr

datafusion/ffi/src/session/mod.rs:568–587  ·  view source on GitHub ↗
(
        &self,
        expr: Expr,
        df_schema: &DFSchema,
    )

Source from the content-addressed store, hash-verified

566 }
567
568 fn create_physical_expr(
569 &self,
570 expr: Expr,
571 df_schema: &DFSchema,
572 ) -> datafusion_common::Result<Arc<dyn PhysicalExpr>> {
573 unsafe {
574 let codec: Arc<dyn LogicalExtensionCodec> =
575 (&self.session.logical_codec).into();
576 let logical_expr = serialize_expr(&expr, codec.as_ref())?.encode_to_vec();
577 let schema = WrappedSchema(FFI_ArrowSchema::try_from(df_schema.as_arrow())?);
578
579 let physical_expr = df_result!((self.session.create_physical_expr)(
580 &self.session,
581 logical_expr.into_iter().collect(),
582 schema
583 ))?;
584
585 Ok((&physical_expr).into())
586 }
587 }
588
589 fn scalar_functions(&self) -> &HashMap<String, Arc<ScalarUDF>> {
590 &self.scalar_functions

Callers 1

test_ffi_sessionFunction · 0.45

Calls 5

serialize_exprFunction · 0.85
WrappedSchemaClass · 0.85
as_arrowMethod · 0.80
intoMethod · 0.45
as_refMethod · 0.45

Tested by 1

test_ffi_sessionFunction · 0.36