You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2023/01/14 12:51:57 UTC

[GitHub] [arrow-datafusion] HaoYang670 commented on a diff in pull request #4888: Update `optimize_children` to return `Result>`

HaoYang670 commented on code in PR #4888:
URL: https://github.com/apache/arrow-datafusion/pull/4888#discussion_r1070261544


##########
datafusion/optimizer/src/common_subexpr_eliminate.rs:
##########
@@ -242,12 +245,16 @@ impl OptimizerRule for CommonSubexprEliminate {
             }
         };
 
-        // add an additional projection if the output schema changed.
-        if optimized_plan.schema() != &original_schema {
-            optimized_plan = build_recover_project_plan(&original_schema, optimized_plan);
+        match optimized_plan {
+            Some(optimized_plan) if optimized_plan.schema() != &original_schema => {
+                // add an additional projection if the output schema changed.
+                Ok(Some(build_recover_project_plan(
+                    &original_schema,
+                    optimized_plan,
+                )))
+            }
+            plan => Ok(plan),

Review Comment:
   Hmm, what is the rationale of this suggestion 🤔? It can't pass the type checker, I'm afraid.



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

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