smiklos commented on code in PR #7257:
URL: https://github.com/apache/arrow-datafusion/pull/7257#discussion_r1289920843


##########
datafusion/optimizer/src/optimizer.rs:
##########
@@ -291,9 +291,13 @@ impl Optimizer {
                 let result = self.optimize_recursively(rule, &new_plan, 
config);
 
                 match result {
-                    Ok(Some(plan)) => {
-                        assert_schema_is_the_same(rule.name(), &new_plan, 
&plan)?;
-                        new_plan = plan;
+                    Ok(Some(optimized_plan)) => {
+                        assert_schema_is_the_same(

Review Comment:
   I think this assertion should be chained with result first such that the 
error handling below can kick in and rules that change the schema can also be 
skipped if needed. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to