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])
| 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. |
| 1303 | pub 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. |
| 1318 | pub fn format_state_name(name: &str, state_name: &str) -> String { |
no test coverage detected
searching dependent graphs…