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

Function merge_schema

datafusion/expr/src/utils.rs:1303–1315  ·  view source on GitHub ↗

merge inputs schema into a single schema. This function merges schemas from multiple logical plan inputs using [`DFSchema::merge`]. Refer to that documentation for details on precedence and metadata handling.

(inputs: &[&LogicalPlan])

Source from the content-addressed store, hash-verified

1301/// This function merges schemas from multiple logical plan inputs using [`DFSchema::merge`].
1302/// Refer to that documentation for details on precedence and metadata handling.
1303pub fn merge_schema(inputs: &[&LogicalPlan]) -> DFSchema {
1304 if inputs.len() == 1 {
1305 inputs[0].schema().as_ref().clone()
1306 } else {
1307 inputs.iter().map(|input| input.schema()).fold(
1308 DFSchema::empty(),
1309 |mut lhs, rhs| {
1310 lhs.merge(rhs);
1311 lhs
1312 },
1313 )
1314 }
1315}
1316
1317/// Build state name. State is the intermediate state of the aggregate function.
1318pub fn format_state_name(name: &str, state_name: &str) -> String {

Callers 5

rewrite_planMethod · 0.85
rewrite_planMethod · 0.85
analyze_internalFunction · 0.85
optimize_internalMethod · 0.85

Calls 8

emptyFunction · 0.50
lenMethod · 0.45
cloneMethod · 0.45
as_refMethod · 0.45
schemaMethod · 0.45
mapMethod · 0.45
iterMethod · 0.45
mergeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…