MCPcopy Create free account
hub / github.com/apache/datafusion / rewrite_extension_inputs

Function rewrite_extension_inputs

datafusion/expr/src/logical_plan/tree_node.rs:364–380  ·  view source on GitHub ↗

Rewrites all inputs for an Extension node "in place" (it currently has to copy values because there are no APIs for in place modification) Should be removed when we have an API for in place modifications of the extension to avoid these copies

(
    extension: Extension,
    f: F,
)

Source from the content-addressed store, hash-verified

362/// Should be removed when we have an API for in place modifications of the
363/// extension to avoid these copies
364fn rewrite_extension_inputs<F: FnMut(LogicalPlan) -> Result<Transformed<LogicalPlan>>>(
365 extension: Extension,
366 f: F,
367) -> Result<Transformed<Extension>> {
368 let Extension { node } = extension;
369
370 node.inputs()
371 .into_iter()
372 .cloned()
373 .map_until_stop_and_collect(f)?
374 .map_data(|new_inputs| {
375 let exprs = node.expressions();
376 Ok(Extension {
377 node: node.with_exprs_and_inputs(exprs, new_inputs)?,
378 })
379 })
380}
381
382/// This macro is used to determine continuation during combined transforming
383/// traversals.

Callers 1

map_childrenMethod · 0.85

Calls 7

map_dataMethod · 0.80
clonedMethod · 0.45
into_iterMethod · 0.45
inputsMethod · 0.45
expressionsMethod · 0.45
with_exprs_and_inputsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…