Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
Impala 2.3.0
-
None
Description
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.
[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
Attachments
Issue Links
- duplicates
-
IMPALA-2710 Overflows during expr evaluation should result in an error or null
- Open
- relates to
-
IMPALA-865 Impala will return incorrect result on int overflow without warning
- Open
-
IMPALA-2710 Overflows during expr evaluation should result in an error or null
- Open