pub fn update_expr(
expr: &Arc<dyn PhysicalExpr>,
projected_exprs: &[(Arc<dyn PhysicalExpr>, String)],
sync_with_child: bool,
) -> Result<Option<Arc<dyn PhysicalExpr>>>
Expand description
The function operates in two modes:
-
When
sync_with_child
istrue
:The function updates the indices of
expr
if the expression resides in the input plan. For instance, given the expressionsa@1 + b@2
andc@0
with the input schemac@2, a@0, b@1
, the expressions are updated toa@0 + b@1
andc@2
. -
When
sync_with_child
isfalse
:The function determines how the expression would be updated if a projection was placed before the plan associated with the expression. If the expression cannot be rewritten after the projection, it returns
None
. For example, given the expressionsc@0
,a@1
andb@2
, and theProjectionExec
with an output schema ofa, c_new
, thenc@0
becomesc_new@1
,a@1
becomesa@0
, butb@2
results inNone
since the projection does not includeb
.