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:
   Here I don't ignore error.
   I feel like this comment isn't related with this PR. So I'm 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: github-unsubscr...@arrow.apache.org

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

Reply via email to