You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/06/30 13:38:09 UTC

[GitHub] [arrow-datafusion] liukun4515 opened a new issue, #2818: CASE When: result type should be coercible to a common type

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

   **Describe the bug**
   
   ```
   ❯ select case when 1=1 then true else 1 end;
   +--------------------------------------------------------------------+
   | CASE WHEN Int64(1) = Int64(1) THEN Boolean(true) ELSE Int64(1) END |
   +--------------------------------------------------------------------+
   | true                                                               |
   +--------------------------------------------------------------------+
   1 row in set. Query took 0.042 seconds.
   ❯ explain select case when 1=1 then true else 1 end;
   +---------------+---------------------------------------------------------------------------------------------------+
   | plan_type     | plan                                                                                              |
   +---------------+---------------------------------------------------------------------------------------------------+
   | logical_plan  | Projection: Boolean(true) AS CASE WHEN Int64(1) = Int64(1) THEN Boolean(true) ELSE Int64(1) END   |
   |               |   EmptyRelation                                                                                   |
   | physical_plan | ProjectionExec: expr=[true as CASE WHEN Int64(1) = Int64(1) THEN Boolean(true) ELSE Int64(1) END] |
   |               |   EmptyExec: produce_one_row=true                                                                 |
   |               |                                                                                                   |
   +---------------+---------------------------------------------------------------------------------------------------+
   2 rows in set. Query took 0.003 seconds.
   ❯ explain select case when 1>1 then true else 1 end;
   +---------------+---------------------------------------------------------------------------------------------------+
   | plan_type     | plan                                                                                              |
   +---------------+---------------------------------------------------------------------------------------------------+
   | logical_plan  | Projection: Boolean(true) AS CASE WHEN Int64(1) > Int64(1) THEN Boolean(true) ELSE Int64(1) END   |
   |               |   EmptyRelation                                                                                   |
   | physical_plan | ProjectionExec: expr=[true as CASE WHEN Int64(1) > Int64(1) THEN Boolean(true) ELSE Int64(1) END] |
   |               |   EmptyExec: produce_one_row=true                                                                 |
   |               |                                                                                                   |
   +---------------+---------------------------------------------------------------------------------------------------+
   2 rows in set. Query took 0.004 seconds.
   ❯  select case when 1>1 then true else 1 end;
   +--------------------------------------------------------------------+
   | CASE WHEN Int64(1) > Int64(1) THEN Boolean(true) ELSE Int64(1) END |
   +--------------------------------------------------------------------+
   | true                                                               |
   +--------------------------------------------------------------------+
   ```
   One case when sql has two diff result data type.
   
   From other system, case when should have the common data type, but now the result type is the first non-null data type.
   
   **To Reproduce**
   Steps to reproduce the behavior:
   
   **Expected behavior**
   A clear and concise description of what you expected to happen.
   
   **Additional context**
   Add any other context about the problem here.
   


-- 
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: github-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] liukun4515 closed issue #2818: CASE When: result type should be coercible to a common type

Posted by GitBox <gi...@apache.org>.
liukun4515 closed issue #2818: CASE When: result type should be coercible to a common type
URL: https://github.com/apache/arrow-datafusion/issues/2818


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] liukun4515 commented on issue #2818: CASE When: result type should be coercible to a common type

Posted by GitBox <gi...@apache.org>.
liukun4515 commented on issue #2818:
URL: https://github.com/apache/arrow-datafusion/issues/2818#issuecomment-1171232102

   I will fix this 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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org