alamb commented on issue #4615: URL: https://github.com/apache/arrow-datafusion/issues/4615#issuecomment-1353590751
> The type coercion and other rules for correctness should be moved in front of the optimizer. > It is the duty of the optimizer to make the query plan to achieve better performance, but not to correct the query. > In another word, the Datafusion should work even if we remove the optimizer. I agree this would be a good change @liukun4515 made a similar observation / suggestion https://github.com/apache/arrow-datafusion/issues/3582 > I'm wondering if this should then be done by failing the optimization (and by fixing this very issue) or by inserting "terminal"/"always error" expressions into the plan that are later picked up by the physical planner. I recommend the inserting an "always error" expr node. The rationale being that you could have branches that are never actually hit in the query A trivial example is like ```sql CASE WHEN FALSE THEN 1 / 0 WHEN TRUE THEN 5.0 END ``` -- 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]
