Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Won't Fix
-
Impala 1.4
-
None
Description
We should be able to cast booleans to decimal (unless I'm missing something). Currently, it runs into an AnalysisException.
[localhost:21000] > select cast(cast(1 as boolean) as float); Query: select cast(cast(1 as boolean) as float) +-----------------------------------+ | cast(cast(1 as boolean) as float) | +-----------------------------------+ | 1 | +-----------------------------------+ Returned 1 row(s) in 0.17s [localhost:21000] > select cast(cast(1 as boolean) as double); Query: select cast(cast(1 as boolean) as double) +------------------------------------+ | cast(cast(1 as boolean) as double) | +------------------------------------+ | 1 | +------------------------------------+ Returned 1 row(s) in 0.18s [localhost:21000] > select cast(cast(1 as boolean) as decimal(1,0)); Query: select cast(cast(1 as boolean) as decimal(1,0)) ERROR: AnalysisException: Invalid type cast of CAST(1 AS BOOLEAN) from BOOLEAN to DECIMAL(1,0)