Details
-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
8.12
-
None
Description
Executing a query like:
select count(distinct case when string_column='X' then bigint_column end) from some_vdb
Translates as the following in Impala:
SELECT COUNT(DISTINCT (CASE WHEN (`string_column` = 'X') THEN `bigint_column` ELSE CAST(NULL AS STRING) END)) as `EXPR_0` FROM `some_table`
Which fails with the following error:
AnalysisException: Incompatible return types 'BIGINT' and 'STRING' of exprs 'integer_column' and 'CAST(NULL AS STRING)'.