jackwener commented on code in PR #4599:
URL: https://github.com/apache/arrow-datafusion/pull/4599#discussion_r1048358679


##########
datafusion/optimizer/src/type_coercion.rs:
##########
@@ -58,9 +58,19 @@ impl OptimizerRule for TypeCoercion {
     fn optimize(
         &self,
         plan: &LogicalPlan,
-        _optimizer_config: &mut OptimizerConfig,
+        optimizer_config: &mut OptimizerConfig,
     ) -> Result<LogicalPlan> {
-        optimize_internal(&DFSchema::empty(), plan)
+        Ok(self
+            .try_optimize(plan, optimizer_config)?
+            .unwrap_or_else(|| plan.clone()))

Review Comment:
   I get it, there is some misunderstand here.
   Here I don't ignore error.
   I felt like this comment isn't related with this PR. So I was a little 
confused about it.
   
   ```rust
               self
               .try_optimize(plan, optimizer_config)?
               .unwrap_or_else(|| plan.clone())
   ```
   
   error will be return by `?`
   
   `unwrap_or_else` is used for `option<>`



-- 
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