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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]