Skip to main content

Module proto_decode

Module proto_decode 

Source
Available on crate feature proto only.
Expand description

Decode-side counterpart to proto_encode.

Expression authors implement an associated try_from_proto on their concrete type, with the signature

fn try_from_proto(
    node: &PhysicalExprNode,
    ctx: &PhysicalExprDecodeCtx<'_>,
) -> Result<Arc<dyn PhysicalExpr>>

It takes the whole PhysicalExprNode — the exact inverse of what PhysicalExpr::try_to_proto returns — so the constructor can also see outer-node fields such as expr_id. The central match in datafusion-proto dispatches ExprType variants to these constructors.

As with the encode side, the public surface is a struct (not a &dyn trait) so future fields/helpers (registries for third-party expressions, schema-resolution caches, etc.) can be added without changing the signature every expression depends on.

Macros§

expect_expr_variant
Open the outer PhysicalExprNode and assert it carries the expected ExprType variant, returning the inner payload (auto-derefs through Box) or bailing with an Internal error.

Structs§

PhysicalExprDecodeCtx
Decoder context handed to per-expression try_from_proto constructors.

Traits§

PhysicalExprDecode
Internal dispatch trait. Implementors live in datafusion-proto. Expression authors should use PhysicalExprDecodeCtx instead of calling this directly.

Functions§

require_proto_field
Unwrap a required non-expression proto field.