You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Tim Armstrong (Jira)" <ji...@apache.org> on 2020/08/13 21:16:00 UTC
[jira] [Resolved] (IMPALA-2633) Inconsistent handling of
out-of-range values in integer casts
[ 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: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org