You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 86b779f
Browse filesBrowse the repository at this point in the historyBrowse files
feat: decode extension PhysicalExprs through a session-scoped registry
`PhysicalExtensionExprNode` carried no type discriminator, so the
`PhysicalExtensionCodec` *was* the discriminator, with the same problems the
plan side has: composition is by registration order, and a name collision
between two independent crates is undetectable.
An extension expression now declares its wire name with `ExtensionExprName`,
implements `PhysicalExprFromProto` like a built-in, writes itself with
`PhysicalExprEncodeCtx::extension_expr_node` (which stamps the name, so the
encoded name and the registry key cannot drift apart), and is registered with
`register_physical_expr` into the `ProtoDecoderRegistry` that the decoding
session carries — the same registry extension `ExecutionPlan`s use, keyed on
the trait as well as the name.
The name is a separate trait from the decode contract so that only extension
expressions can be registered: a built-in has an `ExprType` variant of its
own, and `register_physical_expr::<Column>(..)` does not compile. It lives in
`physical-expr-common`, beside the encode context that stamps it, because
that crate sits below the one that owns the decode contract;
`datafusion_physical_expr::proto` re-exports it.
Decode rule: a named node the session has a decoder for goes to that decoder,
and a failure there is fatal (falling through would let a codec decode a
payload it never wrote); anything else takes the `PhysicalExtensionCodec`
chain exactly as before. If the codec fails too, the missing registration is
added as *context* on the codec's own error, so the kind the codec chose
still reaches a caller that matches on it.
`decode_physical_expr` reads the name off the node rather than taking it as
an argument, so a caller cannot pair a node with a name it does not carry.
Documented in the 56.0.0 upgrade guide; tests in
`datafusion/proto/tests/cases/plans/expr_registry.rs`.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments