[ 
https://issues.apache.org/jira/browse/IMPALA-2633?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tim Armstrong resolved IMPALA-2633.
-----------------------------------
    Resolution: Duplicate

This is a consequence of IMPALA-2710

> Inconsistent handling of out-of-range values in integer casts
> -------------------------------------------------------------
>
>                 Key: IMPALA-2633
>                 URL: https://issues.apache.org/jira/browse/IMPALA-2633
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Backend
>    Affects Versions: Impala 2.3.0
>            Reporter: Tim Armstrong
>            Priority: Major
>              Labels: correctness, downgraded
>
> John Russell discovered some odd behaviour in casttoint. In some cases it 
> returns NULL when the input is an out-of-range value. In others it returns 
> the overflowed value.
> {code}
> [tarmstrong-box.ca.cloudera.com:21000] > select casttoint(hex('1F603'));
> Query: select casttoint(hex('1F603'))
> +-------------------------+
> | casttoint(hex('1f603')) |
> +-------------------------+
> | NULL                    |
> +-------------------------+
> Fetched 1 row(s) in 0.01s
> [tarmstrong-box.ca.cloudera.com:21000] > select hex('1F603');
> Query: select hex('1F603')
> +--------------+
> | hex('1f603') |
> +--------------+
> | 3146363033   |
> +--------------+
> Fetched 1 row(s) in 0.01s
> [tarmstrong-box.ca.cloudera.com:21000] > select casttoint(3146363033);
> Query: select casttoint(3146363033)
> +-----------------------+
> | casttoint(3146363033) |
> +-----------------------+
> | -1148604263           |
> +-----------------------+
> Fetched 1 row(s) in 0.01s
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to