HaoYang670 commented on issue #4615:
URL: 
https://github.com/apache/arrow-datafusion/issues/4615#issuecomment-1360886063

   > 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.
   
   My suggestion is to fail as early as possible if we have detected some 
errors in the logical plan. 
   
   
   > 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
   > ```
   Why do we cover up the error, instead of exposing them? Besides, we should 
not return a compile error at runtime, even if the branch won't be hit. No 
static typed language does this.


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