andygrove commented on code in PR #4233:
URL: https://github.com/apache/arrow-datafusion/pull/4233#discussion_r1024249651


##########
datafusion/optimizer/src/optimizer.rs:
##########
@@ -223,6 +223,12 @@ impl Optimizer {
                 let result = rule.try_optimize(&new_plan, optimizer_config);
                 match result {
                     Ok(Some(plan)) => {
+                        if plan.schema() != new_plan.schema() {
+                            return Err(DataFusionError::Internal(format!(

Review Comment:
   Could we include the expected and actual schema in the error message? This 
will make debugging much easier.



##########
datafusion/optimizer/src/optimizer.rs:
##########
@@ -223,6 +223,12 @@ impl Optimizer {
                 let result = rule.try_optimize(&new_plan, optimizer_config);
                 match result {
                     Ok(Some(plan)) => {
+                        if plan.schema() != new_plan.schema() {
+                            return Err(DataFusionError::Internal(format!(

Review Comment:
   Also, could you add a unit test?



-- 
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...@arrow.apache.org

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

Reply via email to