You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "N Campbell (JIRA)" <ji...@apache.org> on 2012/06/24 14:05:42 UTC

[jira] [Created] (HIVE-3183) case expression should allow different types per ISO-SQL 2012

N Campbell created HIVE-3183:
--------------------------------

             Summary: case expression should allow different types per ISO-SQL 2012
                 Key: HIVE-3183
                 URL: https://issues.apache.org/jira/browse/HIVE-3183
             Project: Hive
          Issue Type: Bug
    Affects Versions: 0.8.0
            Reporter: N Campbell


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 types

select case when vsint.csint is not null then vsint.csint else 1 end from cert.vsint 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HIVE-3183) case expression should allow different types per ISO-SQL 2012

Posted by "Carl Steinbach (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HIVE-3183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carl Steinbach updated HIVE-3183:
---------------------------------

    Component/s: SQL
    
> case expression should allow different types per ISO-SQL 2012
> -------------------------------------------------------------
>
>                 Key: HIVE-3183
>                 URL: https://issues.apache.org/jira/browse/HIVE-3183
>             Project: Hive
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 0.8.0
>            Reporter: N Campbell
>
> 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 types
> select case when vsint.csint is not null then vsint.csint else 1 end from cert.vsint 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: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira