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 "ASF subversion and git services (Jira)" <ji...@apache.org> on 2024/04/25 19:57:00 UTC

[jira] [Commented] (IMPALA-12035) Impala accepts very big numbers but fails to store them correctly

    [ https://issues.apache.org/jira/browse/IMPALA-12035?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17840945#comment-17840945 ] 

ASF subversion and git services commented on IMPALA-12035:
----------------------------------------------------------

Commit 4f033c7750e711c498fb80ff851d4dae0eed55ce in impala's branch refs/heads/master from Daniel Becker
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=4f033c775 ]

IMPALA-12950: Improve error message in case of out-of-range numeric conversions

IMPALA-12035 introduced checks for numeric conversions that are unsafe
and can fail (if the target type cannot store the value, the behaviour
is undefined):
 - from floating-point types to integer types
 - from double to float

However, it can be difficult to trace which part of the query caused
this based on the error message. This change adds the source type, the
destination type and the value to be converted to the error message.
Unfortunately, at this point in the BE, the original SQL is not
available, so we cannot reference that.

Testing:
 - extended existing tests in expr-test.cc.

Change-Id: Ieeed52e25f155818c35c11a8a6821708476ffb32
Reviewed-on: http://gerrit.cloudera.org:8080/21331
Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
Tested-by: Impala Public Jenkins <im...@cloudera.com>


> Impala accepts very big numbers but fails to store them correctly
> -----------------------------------------------------------------
>
>                 Key: IMPALA-12035
>                 URL: https://issues.apache.org/jira/browse/IMPALA-12035
>             Project: IMPALA
>          Issue Type: Bug
>            Reporter: Bakai Ádám
>            Assignee: Daniel Becker
>            Priority: Major
>             Fix For: Impala 4.3.0
>
>
> I tried  to insert rows very big bigints, and it worked as expected with big integers (error message, no new row stored), but it didn’t work as expected with ridiculously big integers( no error message, stored incorrect value). Here are the commands used:
> {code:java}
> drop TABLE my_first_table2;
> CREATE TABLE my_first_table2
> (
>   id BIGINT,
>   name STRING,
>   PRIMARY KEY(id)
> );
> INSERT INTO my_first_table2 VALUES (cast(9 as BIGINT), "sarah");
> -- this works just fine as expected
> INSERT INTO my_first_table2 VALUES (cast(9999999999999999999999 as BIGINT), "sarah");
> -- ERROR: UDF ERROR: Decimal expression overflowed which is expected since it is over bigint max value (source: https://impala.apache.org/docs/build/plain-html/topics/impala_bigint.html#:~:text=Range%3A%20%2D9223372036854775808%20..,9223372036854775807. )
> INSERT INTO my_first_table2 VALUES (cast(999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 as BIGINT), "sarah");
> -- this succeeds and doesn't throw the same error as the previous command which is concerning
> select * from my_first_table2;
> -- there are two rows in the table, and the id is incorrect in one of them  {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org