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


##########
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've stumbled upon this while working on #4614. I think this is wrong: the 
type coercion MUST NOT be skipped in case of an error, otherwise we may end up 
with non-executable plans.



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