Skip to main content

ExecutionPlanEncodeCtx

Struct ExecutionPlanEncodeCtx 

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

Context handed to ExecutionPlan::try_to_proto.

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

Implementations§

Source§

impl<'a> ExecutionPlanEncodeCtx<'a>

Source

pub fn new(encoder: &'a dyn ExecutionPlanEncode) -> Self

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

Source

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

Serialize a single child plan.

Source

pub fn encode_children<'b, I>(&self, plans: I) -> Result<Vec<PhysicalPlanNode>>
where I: IntoIterator<Item = &'b Arc<dyn ExecutionPlan>>,

Serialize an iterator of child plans.

Source

pub fn encode_expr( &self, expr: &Arc<dyn PhysicalExpr>, ) -> Result<PhysicalExprNode>

Serialize a single physical expression.

Source

pub fn encode_expressions<'b, I>( &self, exprs: I, ) -> Result<Vec<PhysicalExprNode>>
where I: IntoIterator<Item = &'b Arc<dyn PhysicalExpr>>,

Serialize an iterator of physical expressions.

Source

pub fn encode_udf(&self, udf: &ScalarUDF) -> Result<Option<Vec<u8>>>

Serialize a scalar UDF to an opaque payload (None = built-in, decodable by name). No proto types cross this boundary.

Source

pub fn encode_udaf(&self, udaf: &AggregateUDF) -> Result<Option<Vec<u8>>>

Serialize an aggregate UDF to an opaque payload (None = decodable by name).

Source

pub fn encode_udwf(&self, udwf: &WindowUDF) -> Result<Option<Vec<u8>>>

Serialize a window UDF to an opaque payload (None = decodable by name).

Source

pub fn expr_ctx(&self) -> PhysicalExprEncodeCtx<'_>

An expression-level encode context backed by this plan context.

Lets a plan hand ctx to expression-level conversions that own their own wire logic — e.g. Partitioning::try_to_proto and PhysicalSortExpr::try_to_proto.

Trait Implementations§

Source§

impl PhysicalExprEncode for ExecutionPlanEncodeCtx<'_>

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

Source§

fn encode(&self, expr: &Arc<dyn PhysicalExpr>) -> Result<PhysicalExprNode>

Encode an expression to a protobuf node.

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