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


##########
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 think @crepererum  is saying that if the type coercion rules fail 
internally (return an Error) it is likely a serious bug in DataFusion and the 
plan will not work as expected.
   
   By effectively ignoring the error here, the error will appear at some later 
stage (e.g. can't run the plan), making it harder to debug the source of the 
issue
   
   🤔 



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