[
https://issues.apache.org/jira/browse/IMPALA-13287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17873384#comment-17873384
]
Xuebin Su commented on IMPALA-13287:
------------------------------------
Hi! I think we can fix this by implementing checked arithmetic with compiler
builtins: [https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html] .
With checked arithmetic, instead of returning a wrong result, Impala will raise
an error if the result exceeds the limit.
For example, for the query above:
{code:java}
[localhost:21050] default> select 10000000000 * 10000000000;
ERROR: Query 4d413dec043903ae:7615da8000000000 failed:
UDF ERROR: Bigint expression overflowed {code}
What do you think? Thanks!
> Imapla returns wrong result when result exceeds the limit of BIGINT
> -------------------------------------------------------------------
>
> Key: IMPALA-13287
> URL: https://issues.apache.org/jira/browse/IMPALA-13287
> Project: IMPALA
> Issue Type: Bug
> Reporter: Xuebin Su
> Priority: Major
>
> {code:java}
> [localhost:21050] default> select 10000000000 * 10000000000;
> +---------------------------+
> | 10000000000 * 10000000000 |
> +---------------------------+
> | 7766279631452241920 |
> +---------------------------+
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]