adriangb commented on code in PR #24003:
URL: https://github.com/apache/datafusion/pull/24003#discussion_r3685155689
##########
datafusion/physical-plan/src/proto.rs:
##########
@@ -190,6 +196,25 @@ impl<'a> ExecutionPlanEncodeCtx<'a> {
pub fn encode_udwf(&self, udwf: &WindowUDF) -> Result<Option<Vec<u8>>> {
self.encoder.encode_udwf(udwf)
}
+
+ /// 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`](datafusion_physical_expr::Partitioning::try_to_proto)
+ /// and
+ ///
[`PhysicalSortExpr::try_to_proto`](datafusion_physical_expr::PhysicalSortExpr::try_to_proto).
Review Comment:
No change needed here: `PhysicalSortExpr` is re-exported from
`datafusion_physical_expr` (`physical-expr/src/lib.rs`), so the link resolves.
Verified with `RUSTDOCFLAGS="-D rustdoc::broken_intra_doc_links" cargo doc
--no-deps -p datafusion-physical-plan --features proto` — clean.
##########
datafusion/physical-plan/src/proto.rs:
##########
@@ -286,6 +311,28 @@ impl<'a> ExecutionPlanDecodeCtx<'a> {
) -> Result<Arc<WindowUDF>> {
self.decoder.decode_udwf(name, payload)
}
+
+ /// 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`](datafusion_physical_expr::Partitioning::try_from_proto).
+ pub fn expr_ctx<'s>(&'s self, input_schema: &'s Schema) ->
PhysicalExprDecodeCtx<'s> {
+ PhysicalExprDecodeCtx::new(input_schema, self)
+ }
+}
+
+/// Lets [`ExecutionPlanDecodeCtx`] back a [`PhysicalExprDecodeCtx`], so
+/// expression-level conversions can be reused from plan hooks.
Review Comment:
This one already reads "back a `PhysicalExprDecodeCtx`" — fixed the
encode-side twin, which did say "an".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]