alamb commented on code in PR #15239:
URL: https://github.com/apache/datafusion/pull/15239#discussion_r1996856449


##########
datafusion/expr/src/logical_plan/invariants.rs:
##########
@@ -112,9 +112,11 @@ fn assert_valid_semantic_plan(plan: &LogicalPlan) -> 
Result<()> {
 /// Returns an error if the plan does not have the expected schema.
 /// Ignores metadata and nullability.
 pub fn assert_expected_schema(schema: &DFSchemaRef, plan: &LogicalPlan) -> 
Result<()> {
-    let equivalent = plan.schema().equivalent_names_and_types(schema);
+    let compatible = plan
+        .schema()
+        .check_arrow_schema_type_compatible(&schema.as_ref().into());
 
-    if !equivalent {
+    if compatible.is_err() {

Review Comment:
   can you please also add the `compatiple` message here? 
   
   Perhaps something like
   
   ```
               "Failed due to a difference in schemas: {e}, original schema: 
{:?}, new schema: {:?}",
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to