Skip to main content

ExecutionPlanDecodeCtx

Struct ExecutionPlanDecodeCtx 

Source
pub struct ExecutionPlanDecodeCtx<'a> { /* private fields */ }
Available on crate feature proto only.
Expand description

Context handed to a plan’s try_from_proto associated function.

Provides the primitives a plan needs to deserialize its children and expressions without naming datafusion-proto.

Implementations§

Source§

impl<'a> ExecutionPlanDecodeCtx<'a>

Source

pub fn new(decoder: &'a dyn ExecutionPlanDecode) -> Self

Create a new decode context wrapping an [ExecutionPlanDecode] implementation (supplied by datafusion-proto).

Source

pub fn decode_child( &self, node: &PhysicalPlanNode, ) -> Result<Arc<dyn ExecutionPlan>>

Deserialize a single child plan.

Source

pub fn decode_child_with_scalar_subquery_results( &self, node: &PhysicalPlanNode, results: ScalarSubqueryResults, ) -> Result<Arc<dyn ExecutionPlan>>

Deserialize a child plan with results active for scalar subquery expressions in that plan’s subtree.

Source

pub fn decode_required_child( &self, node: Option<&PhysicalPlanNode>, plan_name: &str, field: &str, ) -> Result<Arc<dyn ExecutionPlan>>

Deserialize a required child plan, producing a uniform “missing required field” error when the optional wire field is absent.

Source

pub fn decode_expr( &self, node: &PhysicalExprNode, input_schema: &Schema, ) -> Result<Arc<dyn PhysicalExpr>>

Deserialize a physical expression against input_schema.

Source

pub fn decode_required_expr( &self, node: Option<&PhysicalExprNode>, input_schema: &Schema, plan_name: &str, field: &str, ) -> Result<Arc<dyn PhysicalExpr>>

Deserialize a required physical expression against input_schema.

Source

pub fn task_ctx(&self) -> &TaskContext

The session task context (function registry + session config). Never exposes the proto extension codec.

Source

pub fn decode_udf( &self, name: &str, payload: Option<&[u8]>, ) -> Result<Arc<ScalarUDF>>

Reconstruct a scalar UDF from its name and optional payload. The lookup-order policy is owned by datafusion-proto; no proto types cross this boundary.

Source

pub fn decode_udaf( &self, name: &str, payload: Option<&[u8]>, ) -> Result<Arc<AggregateUDF>>

Reconstruct an aggregate UDF from its name and optional payload.

Source

pub fn decode_udwf( &self, name: &str, payload: Option<&[u8]>, ) -> Result<Arc<WindowUDF>>

Reconstruct a window UDF from its name and optional payload.

Source

pub fn expr_ctx<'s>( &'s self, input_schema: &'s Schema, ) -> PhysicalExprDecodeCtx<'s>

An expression-level decode context backed by this plan context, bound to input_schema.

The decode counterpart of ExecutionPlanEncodeCtx::expr_ctx, for calling conversions such as Partitioning::try_from_proto.

Trait Implementations§

Source§

impl PhysicalExprDecode for ExecutionPlanDecodeCtx<'_>

Lets ExecutionPlanDecodeCtx back a PhysicalExprDecodeCtx, so expression-level conversions can be reused from plan hooks.

Source§

fn decode( &self, node: &PhysicalExprNode, schema: &Schema, ) -> Result<Arc<dyn PhysicalExpr>>

Decode a proto node into a concrete PhysicalExpr. The schema is passed alongside so implementations can support recursive children and rebind the context per call (e.g. for nested plans).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V