kumarUjjawal commented on code in PR #23731:
URL: https://github.com/apache/datafusion/pull/23731#discussion_r3619701884
##########
datafusion/proto/src/physical_plan/mod.rs:
##########
@@ -1184,32 +1184,16 @@ pub trait PhysicalPlanNodeExt: Sized {
)]
fn try_into_projection_physical_plan(
&self,
- projection: &protobuf::ProjectionExecNode,
+ _projection: &protobuf::ProjectionExecNode,
ctx: &PhysicalPlanDecodeContext<'_>,
proto_converter: &dyn PhysicalProtoConverterExtension,
) -> Result<Arc<dyn ExecutionPlan>> {
- let input: Arc<dyn ExecutionPlan> =
- into_physical_plan(&projection.input, ctx, proto_converter)?;
- let exprs = projection
- .expr
- .iter()
- .zip(projection.expr_name.iter())
- .map(|(expr, name)| {
- Ok((
- proto_converter.proto_to_physical_expr(
- expr,
- input.schema().as_ref(),
- ctx,
- )?,
- name.to_string(),
- ))
- })
- .collect::<Result<Vec<(Arc<dyn PhysicalExpr>, String)>>>()?;
- let proj_exprs: Vec<ProjectionExpr> = exprs
- .into_iter()
- .map(|(expr, alias)| ProjectionExpr { expr, alias })
- .collect();
- Ok(Arc::new(ProjectionExec::try_new(proj_exprs, input)?))
+ let decoder = ConverterPlanDecoder {
+ ctx,
+ proto_converter,
+ };
+ let decode_ctx = ExecutionPlanDecodeCtx::new(&decoder);
+ ProjectionExec::try_from_proto(self.node(), &decode_ctx)
Review Comment:
We used to decode the supplied projection and now we ignore it and decodes
self.node(). Wouldn't a caller get the wrong plan or a wrong-variant error?
Was this intentional?
--
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]