hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiu (JIRA)" <>
Subject [jira] [Updated] (HIVE-3183) case expression should allow different types per ISO-SQL 2012
Date Thu, 29 Aug 2013 00:17:52 GMT


Xiu updated HIVE-3183:

    Attachment: udf_when_type_wrong3.q.out

This patch removes the restriction on 'when' clause. So some negative testcases become positive,


They should be moved from 'ql/src/test/queries/clientnegative/' to 'ql/src/test/queries/clientpositive/',
and be renamed to reflect its positive nature.

Also in ql/src/test/results/clientpositive/


need to be added.
> case expression should allow different types per ISO-SQL 2012
> -------------------------------------------------------------
>                 Key: HIVE-3183
>                 URL:
>             Project: Hive
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 0.8.0
>            Reporter: N Campbell
>         Attachments: Hive-3183.patch.txt, udf_when_type_wrong2.q.out, udf_when_type_wrong3.q.out
> The ISO-SQL standard specification for CASE allows the specification to include different
types in the WHEN and ELSE blocks including this example which mixes smallint and integer
> select case when vsint.csint is not null then vsint.csint else 1 end from cert.vsint
> The Apache Hive docs do not state how it deviates from the standard or any given restrictions
so unsure if this is a bug vs an enhancement. Many SQL applications mix so this seems to be
a restrictive implementation if this is by design.
> Argument type mismatch '1': The expression after ELSE should have the same type as those
after THEN: "smallint" is expected but "int" is found

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message