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

Function assert_expected_schema

datafusion/expr/src/logical_plan/invariants.rs:114–124  ·  view source on GitHub ↗

Returns an error if the plan does not have the expected schema. Ignores metadata and nullability.

(schema: &DFSchemaRef, plan: &LogicalPlan)

Source from the content-addressed store, hash-verified

112/// Returns an error if the plan does not have the expected schema.
113/// Ignores metadata and nullability.
114pub fn assert_expected_schema(schema: &DFSchemaRef, plan: &LogicalPlan) -> Result<()> {
115 let compatible = plan.schema().logically_equivalent_names_and_types(schema);
116
117 assert_or_internal_err!(
118 compatible,
119 "Failed due to a difference in schemas: original schema: {:?}, new schema: {:?}",
120 schema,
121 plan.schema()
122 );
123 Ok(())
124}
125
126/// Asserts that the subqueries are structured properly with valid node placement.
127///

Callers 1

Calls 2

schemaMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…