-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
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.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working