HaoYang670 opened a new issue, #4660:
URL: https://github.com/apache/arrow-datafusion/issues/4660

   **Describe the bug**
   A clear and concise description of what the bug is.
   The type of `case` expression is not checked when building the plan.
   
   **To Reproduce**
   ```sql
   DataFusion CLI v15.0.0
   ❯ create table t as select 2 as a;
   0 rows in set. Query took 0.013 seconds.
   ❯ select case
       when a = 1 then true
       when a = 2 then 'abc'
       else 123
     end  
   from t;
   Internal("The type of Boolean AND Utf8 of binary physical should be same")
   ```
   
   **Expected behavior**
   We should return an `DatafusionError::Plan(...)`, instead of an `Internal` 
error.
   
   **Additional context**
   The `CaseBuilder` does some type checking, but it seems that it is bypassed.
   
https://github.com/apache/arrow-datafusion/blob/c2f199adbec8b650de5668c97675f8a757607df8/datafusion/expr/src/conditional_expressions.rs#L100-L110
   


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