Skip to content

Commit 9c626cd

Browse files
adriangbclaude
andauthored
feat: allow extension PhysicalExprs to decode via a per-type registry (apache#24628)
## Which issue does this PR close? - Closes apache#24626. ## Rationale for this change ### The user-visible problem A library that ships its own `PhysicalExpr` has to write a `PhysicalExtensionCodec` to serialize it, in a file separate from the expression, and two such libraries on one session have to compose their codecs by hand. `PhysicalExtensionExprNode` carries an opaque payload and the encoded children but no type discriminator, so the codec *is* the discriminator: `ComposedPhysicalExtensionCodec` writes the **position** of the encoding codec into the payload bytes, the decoding side must register the same codecs in the same order, and a name collision between two independent crates cannot be detected. A decoder also had no way to reach session state. `PhysicalExprDecodeCtx` had `schema()` and `decode()` but nothing like `ExecutionPlanDecodeCtx::task_ctx()`, so an extension expression could not resolve a UDF from the function registry or read session configuration while decoding. ### Where this sits in the bigger picture Physical-plan serialization is moving from central `downcast_ref` chains in `datafusion-proto` to per-type hooks that live next to each type: `try_to_proto` (a trait method) plus a `try_from_proto` constructor. apache#22418 did this for built-in `PhysicalExpr`s and apache#23494 for `ExecutionPlan`s. Third-party types could use the encode half but not the decode half. This PR closes the loop for `PhysicalExpr`; apache#24631 does the same for `ExecutionPlan` with the same shape and names (`Extension*FromProto` pairing the wire name with the constructor, `register_*`/`decode_*` facades over one shared registry, attached through `SessionConfig::with_extension`). **This PR depends on apache#24631, which adds the shared `ProtoDecoderRegistry` that both kinds register into; it must land first. ### How this relates to `PhysicalExtensionCodec` The codec is **not deprecated** and this PR does not touch `ComposedPhysicalExtensionCodec`. The decode rule is: - A `PhysicalExtensionExprNode` **with an `expr_name` the decoding session has registered** decodes through the expression's own `ExtensionExprFromProto::try_from_proto`. A failure there is fatal: falling through to the codec would let it wrongly decode a payload it never wrote. - **Anything else** (no name, or a name this session does not know) takes `PhysicalExtensionCodec::try_decode_expr` exactly as before. If the codec also fails, the error names the missing registration and lists what the session does know. The codec keeps UDF/UDAF/UDWF payloads (a function is an instance, not a type), anything not yet migrated, and the released `FFI_PhysicalExtensionCodec` that datafusion-python exposes. ### How FFI will work The registry stores decoders as a **private** `fn` pointer; the public surface is `ExtensionExprFromProto`, `extension_expr_node` and the facade functions. The storage can later grow to carry an FFI vtable and private data without breaking anything shipped here. `PhysicalExprNode` crosses an ABI as prost bytes, the pattern `datafusion-ffi` already uses for `Statistics`. ## What changes are included in this PR? Built-in expression serialization is untouched: built-ins keep their inherent `try_from_proto`, dispatched from their own `ExprType` variant, and no built-in code or caller changes. - **Wire field.** `PhysicalExtensionExprNode` gains `optional string expr_name = 3;` — additive and proto3-compatible. The codec encode path writes `None`. - **Session access while decoding.** `PhysicalExprDecodeCtx::session::<T>() -> Option<&T>` returns the session the decode runs under, type-erased because `TaskContext` lives in a crate that depends on this one. It is backed by a new defaulted `PhysicalExprDecode::session()` method (returns `None`); `ExecutionPlanDecodeCtx` supplies its `TaskContext`, so a decoder calls `ctx.session::<TaskContext>()`. `PhysicalExprDecodeCtx` is not generic and its constructor is unchanged. - **`expr_id` stamping.** `serialize_physical_expr_with_converter` now sets the expression's `expression_id()` on a node returned by `try_to_proto` when the hook left `expr_id` empty (a hook that sets its own keeps it). Without this, an identity-bearing extension written with `extension_expr_node` would lose its identity and defeat `DeduplicatingProtoConverter`. - **`ExtensionExprFromProto`** (in `datafusion_physical_expr::proto`). An extension expression implements this one trait, pairing `const NAME` with `fn try_from_proto(node: &PhysicalExprNode, ctx: &PhysicalExprDecodeCtx<'_>)`. Its `try_to_proto` is one call — `extension_expr_node::<Self>(ctx, payload, self.children())` — which builds the node and stamps `Self::NAME`, so the encoded name and the registry key cannot drift apart. Built-ins do not implement it, so `register_physical_expr::<Column>(..)` does not compile (a `compile_fail` doctest checks this). `extension_expr_node` is a free function because `PhysicalExprEncodeCtx` lives in `datafusion-physical-expr-common`, below the crate that can name the trait. - **Registration** goes into the `ProtoDecoderRegistry` from apache#24631: call `register_physical_expr::<T>(&mut registry)` for every extension expression the session must decode, and attach it with `SessionConfig::with_extension`. Registering the same type twice is a no-op; a *different* type under a taken name, or an empty name, is an error. Names are scoped per kind, so a plan and an expression may share a name in one registry. This crate adds `register_physical_expr`, `physical_expr_names`, and `decode_physical_expr` (`#[doc(hidden)]`, internal to `datafusion-proto`; it reads the name off the node so a caller cannot pair a node with a name it does not carry). - **Re-exports.** `datafusion::physical_plan::proto` re-exports `ExtensionExprFromProto`, `extension_expr_node`, `register_physical_expr`, `physical_expr_names`, `decode_physical_expr`, `PhysicalExprDecodeCtx` and `PhysicalExprEncodeCtx`, alongside the `ExecutionPlan` facade and `ProtoDecoderRegistry`. - **Decode dispatch** in `datafusion-proto` per the rule above (when the codec fallback also fails, the missing registration is added as *context* on the codec's own error so its kind still reaches callers), a doc pointer on `PhysicalExtensionCodec::try_decode_expr`, and an upgrade-guide entry in 56.0.0. ### Why a separate trait rather than a method on `PhysicalExpr` 1. An associated constant makes a trait not dyn-compatible (`E0038`), which breaks every `Arc<dyn PhysicalExpr>`, so the wire name cannot live on `PhysicalExpr`. 2. Cargo unifies features across the graph, so a *required* method on a `proto`-gated trait is `E0046` in a downstream crate that never enabled the feature. 3. With a default, a forgotten decoder becomes a decode-time `NotImplemented` instead of a compile error. Decoding is a constructor with no `self` and can never be dispatched through `&dyn PhysicalExpr`, so the encode/decode asymmetry is structural. Session scoping goes through `SessionConfig` extensions rather than a new field on `TaskContext`/`SessionState`, which would force `datafusion-physical-expr-common/proto` on for everyone. ## What is the testing strategy for this PR? `datafusion/proto/tests/cases/plans/expr_registry.rs`, 10 tests. A `RefusingCodec` errors on every method, so any codec involvement is fatal; a codec that *can* decode the same payload makes the fallback paths distinguishable from mere failure. - Registry decode end to end with no codec on either side, including reading the session from the decoder. - Fallback: unnamed or unregistered names reach the codec; a codec failure keeps its own error and names the missing registration. - Registration rejects collisions and empty names; same type twice is a no-op. - Nested extension expressions both decode through the registry. - A failing registry decoder does not fall through to a codec that could decode the node. - An extension expression resolves a scalar UDF and an aggregate UDF from the reading session via `ctx.session::<TaskContext>()`. - A whole plan roundtrip through `physical_plan_to_bytes_with_extension_codec` / `physical_plan_from_bytes_with_extension_codec`. - An identity-bearing extension referenced twice keeps its `expression_id()` under `DeduplicatingProtoConverter`: shared state is preserved and children decode correctly. - A registered extension plan and expression with the same wire name roundtrip together in one plan. ## Are there any user-facing changes? Additive. Nobody is affected unless they opt in; there are no breaking API changes. Documented in the 56.0.0 upgrade guide. Two things worth a reviewer's attention: - The wire field is additive for binary protobuf but not for the optional JSON serde: generated JSON deserializers reject unknown fields, so a node carrying `exprName` needs a reader built after this change. - The codec fallback is only equivalent for nodes written the old way. Once an expression's `try_to_proto` writes its own named node, a reader that fails to register the type hands that payload to `try_decode_expr`, and a codec that still recognizes the expression may decode the new payload as the old message. The upgrade guide says to register migrated expressions on every reader before writers start using them. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5.1 <[email protected]>
1 parent 6e8372f commit 9c626cd

13 files changed

Lines changed: 1434 additions & 13 deletions

File tree

‎datafusion/physical-expr-common/src/physical_expr.rs‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,7 @@ pub mod proto_encode {
630630
/// [`PhysicalExprNode`]: datafusion_proto_models::protobuf::PhysicalExprNode
631631
#[cfg(feature = "proto")]
632632
pub mod proto_decode {
633+
use std::any::Any;
633634
use std::sync::Arc;
634635

635636
use arrow::datatypes::Schema;
@@ -704,6 +705,17 @@ pub mod proto_decode {
704705
self.schema
705706
}
706707

708+
/// The session this decode runs under, if the decoder supplied one
709+
/// and it is a `T`.
710+
///
711+
/// `datafusion-proto` supplies its `TaskContext`, so an expression that
712+
/// resolves a UDF by name or reads configuration calls
713+
/// `ctx.session::<TaskContext>()`. The session is type-erased because
714+
/// `TaskContext` is defined in a crate that depends on this one.
715+
pub fn session<T: 'static>(&self) -> Option<&T> {
716+
self.decoder.session()?.downcast_ref()
717+
}
718+
707719
/// Decode an expression node, recursing into child sub-expressions.
708720
///
709721
/// Routes built-in `ExprType` variants through `datafusion-proto`'s
@@ -793,6 +805,12 @@ pub mod proto_decode {
793805
node: &PhysicalExprNode,
794806
schema: &Schema,
795807
) -> Result<Arc<dyn PhysicalExpr>>;
808+
809+
/// The session the decode runs under, read through
810+
/// [`PhysicalExprDecodeCtx::session`]. Defaults to `None`.
811+
fn session(&self) -> Option<&dyn Any> {
812+
None
813+
}
796814
}
797815
}
798816

‎datafusion/physical-expr/src/lib.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ mod partitioning;
4040
mod physical_expr;
4141
pub mod planner;
4242
pub mod projection;
43+
#[cfg(feature = "proto")]
44+
pub mod proto;
4345
/// Shared test helpers for the `try_to_proto` / `try_from_proto` unit tests
4446
#[cfg(all(test, feature = "proto"))]
4547
pub(crate) mod proto_test_util;
Lines changed: 238 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,238 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
//! The `PhysicalExpr` face of the session-scoped [`ProtoDecoderRegistry`],
19+
//! which routes extension expressions to their decoders by name:
20+
//! [`register_physical_expr`] and [`physical_expr_names`], all keyed on `dyn PhysicalExpr`. The store itself
21+
//! is shared with every other extension kind, so a session carries one
22+
//! registry.
23+
24+
use std::sync::Arc;
25+
26+
use datafusion_common::Result;
27+
use datafusion_physical_expr_common::physical_expr::PhysicalExpr;
28+
pub use datafusion_physical_expr_common::physical_expr::proto_decode::PhysicalExprDecodeCtx;
29+
pub use datafusion_physical_expr_common::physical_expr::proto_encode::PhysicalExprEncodeCtx;
30+
pub use datafusion_proto_models::ProtoDecoderRegistry;
31+
use datafusion_proto_models::protobuf::PhysicalExprNode;
32+
use datafusion_proto_models::protobuf::physical_expr_node::ExprType;
33+
34+
/// The wire name of an extension [`PhysicalExpr`], and the constructor that
35+
/// rebuilds it.
36+
///
37+
/// Only extension expressions implement this. A built-in expression has an
38+
/// `ExprType` variant of its own, keeps the inherent `try_from_proto`
39+
/// dispatched from that variant, and has no wire name to be registered under —
40+
/// so [`register_physical_expr`] will not accept one.
41+
///
42+
/// One impl block says what the expression is called and how it decodes; its
43+
/// `try_to_proto` on [`PhysicalExpr`] writes the matching node with
44+
/// [`extension_expr_node`]:
45+
///
46+
/// ```ignore
47+
/// impl PhysicalExpr for MyExpr {
48+
/// // ...
49+
/// fn try_to_proto(
50+
/// &self,
51+
/// ctx: &PhysicalExprEncodeCtx<'_>,
52+
/// ) -> Result<Option<PhysicalExprNode>> {
53+
/// // Stamps `Self::NAME`, so the encoded name and the registry key
54+
/// // cannot drift apart.
55+
/// Ok(Some(extension_expr_node::<Self>(
56+
/// ctx,
57+
/// self.state.to_bytes()?,
58+
/// self.children(),
59+
/// )?))
60+
/// }
61+
/// }
62+
///
63+
/// impl ExtensionExprFromProto for MyExpr {
64+
/// // Namespace the name with the owning crate, so a collision with
65+
/// // another crate is an error at registration and not a wrong decode.
66+
/// const NAME: &'static str = "my_crate.MyExpr";
67+
///
68+
/// fn try_from_proto(
69+
/// node: &PhysicalExprNode,
70+
/// ctx: &PhysicalExprDecodeCtx<'_>,
71+
/// ) -> Result<Arc<dyn PhysicalExpr>> {
72+
/// let extension = expect_expr_variant!(
73+
/// node,
74+
/// physical_expr_node::ExprType::Extension,
75+
/// "Extension",
76+
/// );
77+
/// let state = MyState::from_bytes(&extension.expr)?;
78+
/// let children = ctx.decode_children_expressions(&extension.inputs)?;
79+
/// Ok(Arc::new(MyExpr::new(state, children)))
80+
/// }
81+
/// }
82+
///
83+
/// let mut registry = ProtoDecoderRegistry::new();
84+
/// register_physical_expr::<MyExpr>(&mut registry)?;
85+
/// let config = SessionConfig::new().with_extension(Arc::new(registry));
86+
/// ```
87+
pub trait ExtensionExprFromProto: PhysicalExpr + Sized {
88+
/// The name this expression type is written and registered under.
89+
///
90+
/// Namespace it with the owning crate — `"my_crate.MyExpr"`, not
91+
/// `"MyExpr"` — so that two independent crates registering into the same
92+
/// session collide at registration time instead of silently decoding each
93+
/// other's nodes. Never write it by hand on the wire:
94+
/// [`extension_expr_node`] stamps it for you.
95+
const NAME: &'static str;
96+
97+
/// Rebuild the expression from the `PhysicalExprNode` its
98+
/// [`PhysicalExpr::try_to_proto`] wrote.
99+
///
100+
/// Takes the whole node — the exact inverse of what `try_to_proto`
101+
/// returns — so the constructor can also see outer-node fields such as
102+
/// `expr_id`. `ctx.session::<TaskContext>()` gives the session, for
103+
/// resolving UDFs by name or reading configuration.
104+
fn try_from_proto(
105+
node: &PhysicalExprNode,
106+
ctx: &PhysicalExprDecodeCtx<'_>,
107+
) -> Result<Arc<dyn PhysicalExpr>>;
108+
}
109+
110+
/// Build the `PhysicalExprNode` for an extension expression `T`: an
111+
/// `Extension` variant carrying `payload`, the encoded `children`, and `T`'s
112+
/// [`NAME`](ExtensionExprFromProto::NAME).
113+
///
114+
/// The one supported way for an extension expression to write itself. It is a
115+
/// free function rather than a method on [`PhysicalExprEncodeCtx`] because the
116+
/// context lives in `datafusion-physical-expr-common`, below the crate that
117+
/// can name [`ExtensionExprFromProto`].
118+
pub fn extension_expr_node<T: ExtensionExprFromProto>(
119+
ctx: &PhysicalExprEncodeCtx<'_>,
120+
payload: Vec<u8>,
121+
children: Vec<&Arc<dyn PhysicalExpr>>,
122+
) -> Result<PhysicalExprNode> {
123+
Ok(PhysicalExprNode {
124+
expr_type: Some(ExprType::Extension(
125+
datafusion_proto_models::protobuf::PhysicalExtensionExprNode {
126+
expr: payload,
127+
inputs: ctx.encode_children_expressions(children)?,
128+
expr_name: Some(T::NAME.to_string()),
129+
},
130+
)),
131+
..Default::default()
132+
})
133+
}
134+
135+
/// How this facade stores a decoder in the shared registry: a function pointer
136+
/// to the monomorphized [`ExtensionExprFromProto::try_from_proto`].
137+
///
138+
/// Deliberately private, and the same type on both the
139+
/// [`register_physical_expr`] and the [`decode_physical_expr`] side.
140+
/// [`ExtensionExprFromProto`] is the public contract and
141+
/// [`decode_physical_expr`] (hidden, internal to DataFusion) is the only way
142+
/// to invoke one, so the storage
143+
/// can change later without a breaking change.
144+
type PhysicalExprDecoder =
145+
fn(&PhysicalExprNode, &PhysicalExprDecodeCtx<'_>) -> Result<Arc<dyn PhysicalExpr>>;
146+
147+
/// Register `T` in `registry` under its [`ExtensionExprFromProto::NAME`].
148+
///
149+
/// Registering the same type twice is a no-op. Registering a *different* type
150+
/// under a name already taken is an error, so collisions surface here rather
151+
/// than as a wrong decode later. The name is scoped to `dyn PhysicalExpr`, so a
152+
/// plan or a data source may use the same name in the same registry.
153+
///
154+
/// # Who builds the registry
155+
///
156+
/// The application that owns the session builds it. A session carries at most
157+
/// one registry, and `SessionConfig::with_extension` replaces what is there, so
158+
/// a library must never attach a registry of its own: it would silently discard
159+
/// another library's. A library exposes a function that fills a registry it is
160+
/// handed, and the application composes them. One registry holds every kind, so
161+
/// a library registers its plans and its expressions into the same object.
162+
///
163+
/// # A built-in expression cannot be registered
164+
///
165+
/// The bound is [`ExtensionExprFromProto`], which only extension expressions
166+
/// implement. A built-in keeps an inherent `try_from_proto`, dispatched from
167+
/// its own `ExprType` variant:
168+
///
169+
/// ```
170+
/// use datafusion_physical_expr::expressions::Column;
171+
///
172+
/// let _ = Column::try_from_proto;
173+
/// ```
174+
///
175+
/// but it is not an extension, and registering it does not compile:
176+
///
177+
/// ```compile_fail
178+
/// use datafusion_physical_expr::expressions::Column;
179+
/// use datafusion_physical_expr::proto::register_physical_expr;
180+
/// use datafusion_proto_models::ProtoDecoderRegistry;
181+
///
182+
/// let mut registry = ProtoDecoderRegistry::new();
183+
/// register_physical_expr::<Column>(&mut registry).unwrap();
184+
/// ```
185+
pub fn register_physical_expr<T: ExtensionExprFromProto>(
186+
registry: &mut ProtoDecoderRegistry,
187+
) -> Result<()> {
188+
registry.register_decoder::<dyn PhysicalExpr, T, PhysicalExprDecoder>(
189+
T::NAME,
190+
T::try_from_proto,
191+
)
192+
}
193+
194+
/// Decode `node` with the extension expression decoder registered under the
195+
/// name `node` carries.
196+
///
197+
/// The name is read from the node's `Extension` variant rather than passed in,
198+
/// so a caller cannot pair a node with a name it does not carry.
199+
///
200+
/// `None` means "this node names no extension expression decoder of ours": it
201+
/// is not an extension node, it carries no name, or no registered name matches.
202+
/// The caller then falls back to the `PhysicalExtensionCodec` chain.
203+
/// `Some(Err(..))` means the decoder that *does* own the name failed, which is
204+
/// fatal: falling back there would let a codec decode the payload wrongly, the
205+
/// very thing the name exists to prevent.
206+
///
207+
/// Not intended as public API: `datafusion-proto` drives decoding and is the
208+
/// only intended caller. It is `pub` only because that call crosses a crate
209+
/// boundary, so it is hidden from the docs and may change without notice.
210+
#[doc(hidden)]
211+
pub fn decode_physical_expr(
212+
registry: &ProtoDecoderRegistry,
213+
node: &PhysicalExprNode,
214+
ctx: &PhysicalExprDecodeCtx<'_>,
215+
) -> Option<Result<Arc<dyn PhysicalExpr>>> {
216+
let name = expr_name(node)?;
217+
let decoder = registry.decoder::<dyn PhysicalExpr, PhysicalExprDecoder>(name)?;
218+
Some(decoder(node, ctx))
219+
}
220+
221+
/// Every extension expression name registered in `registry`, in arbitrary
222+
/// order.
223+
///
224+
/// Names registered for another kind are not included.
225+
pub fn physical_expr_names(
226+
registry: &ProtoDecoderRegistry,
227+
) -> impl Iterator<Item = &str> {
228+
registry.names::<dyn PhysicalExpr>()
229+
}
230+
231+
/// The registry name `node` was written with, if it is an extension node that
232+
/// carries one.
233+
fn expr_name(node: &PhysicalExprNode) -> Option<&str> {
234+
match node.expr_type.as_ref()? {
235+
ExprType::Extension(extension) => extension.expr_name.as_deref(),
236+
_ => None,
237+
}
238+
}

‎datafusion/physical-plan/src/proto/mod.rs‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,14 @@ use datafusion_execution::TaskContext;
7979
use datafusion_expr::physical_planning_context::ScalarSubqueryResults;
8080
use datafusion_expr::{AggregateUDF, ScalarUDF, WindowUDF};
8181
use datafusion_physical_expr::PhysicalExpr;
82-
use datafusion_physical_expr_common::physical_expr::proto_decode::{
83-
PhysicalExprDecode, PhysicalExprDecodeCtx,
84-
};
85-
use datafusion_physical_expr_common::physical_expr::proto_encode::{
86-
PhysicalExprEncode, PhysicalExprEncodeCtx,
82+
pub use datafusion_physical_expr::proto::{
83+
ExtensionExprFromProto, decode_physical_expr, extension_expr_node,
84+
physical_expr_names, register_physical_expr,
8785
};
86+
use datafusion_physical_expr_common::physical_expr::proto_decode::PhysicalExprDecode;
87+
pub use datafusion_physical_expr_common::physical_expr::proto_decode::PhysicalExprDecodeCtx;
88+
use datafusion_physical_expr_common::physical_expr::proto_encode::PhysicalExprEncode;
89+
pub use datafusion_physical_expr_common::physical_expr::proto_encode::PhysicalExprEncodeCtx;
8890
use datafusion_proto_models::protobuf::physical_plan_node::PhysicalPlanType;
8991
use datafusion_proto_models::protobuf::{
9092
PhysicalExprNode, PhysicalExtensionNode, PhysicalPlanNode,
@@ -435,6 +437,10 @@ impl PhysicalExprDecode for ExecutionPlanDecodeCtx<'_> {
435437
) -> Result<Arc<dyn PhysicalExpr>> {
436438
self.decode_expr(node, schema)
437439
}
440+
441+
fn session(&self) -> Option<&dyn std::any::Any> {
442+
Some(self.task_ctx())
443+
}
438444
}
439445

440446
/// Assert that a [`PhysicalPlanNode`] carries the expected `PhysicalPlanType`

‎datafusion/proto-models/proto/datafusion.proto‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,6 +1302,11 @@ message PhysicalNegativeNode {
13021302
message PhysicalExtensionExprNode {
13031303
bytes expr = 1;
13041304
repeated PhysicalExprNode inputs = 2;
1305+
// Optional type discriminator naming the extension expression, e.g.
1306+
// "my_crate.MyExpr". When present and registered in the session's
1307+
// ProtoDecoderRegistry, decoding is routed to that registered
1308+
// decoder; otherwise it falls back to PhysicalExtensionCodec::try_decode_expr.
1309+
optional string expr_name = 3;
13051310
}
13061311

13071312
message PhysicalHashExprNode {

0 commit comments

Comments
 (0)