Files
impala/testdata/workloads/functional-query/queries/QueryTest/decimal-insert-overflow-exprs.test
Riza Suminto 047cf9ff4d IMPALA-13954: Validate num inserted rows via NumModifiedRows counter
This patch changes the way test validate num inserted rows from checking
the beeswax-specific result to checking NumModifiedRows counter from
query profile.

Remove skiping over hs2 protocol in test_chars.py and refactor
test_date_queries.py a bit to reduce test skiping. Added HS2_TYPES in
tests that requires it and fix some flake8 issues.

Testing:
Run and pass all affected tests.

Change-Id: I96eae9967298f75b2c9e4d0662fcd4a62bf5fffc
Reviewed-on: http://gerrit.cloudera.org:8080/22770
Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Tested-by: Riza Suminto <riza.suminto@cloudera.com>
2025-04-11 20:31:50 +00:00

117 lines
4.3 KiB
Plaintext

====
---- QUERY
# Verify that decimal value, which is expressed with constant decimal expression and its
# value is not overflowed, is inserted into the table.
set decimal_v2=true;
insert into table overflowed_decimal_tbl_1
select 1, cast(cast(65496456343.9565 as decimal (28,7))*44658*2.111
as decimal (28,10));
---- RUNTIME_PROFILE
NumModifiedRows: 1
====
---- QUERY
# Verify that decimal value, which is expressed with decimal expression with one
# alias and its value is not overflowed, is inserted into the table.
set decimal_v2=true;
insert into table overflowed_decimal_tbl_1
select 2, cast(a*44658*2.111 as decimal (28,10)) from
(select cast(65496456.9565 as decimal (28,7)) as a) q;
---- RUNTIME_PROFILE
NumModifiedRows: 1
====
---- QUERY
# Verify that decimal value, which is expressed with decimal expression with three
# aliases and its value is not overflowed, is inserted into the table.
set decimal_v2=true;
insert into table overflowed_decimal_tbl_1
select 3, cast(a*b*c as decimal (28,10)) from
(select cast(65496456.9565 as decimal (28,7)) as a,
cast(44658 as decimal (28,7)) as b,
cast(2.111 as decimal (28,7)) as c) q;
---- RUNTIME_PROFILE
NumModifiedRows: 1
====
---- QUERY
# Verify that overflow behaviour of decimal_v1 is unchanged.
# Verify decimal value, which is expressed with constant decimal expression
# and its value is overflowed, is inserted into the table as NULL when
# decimal_v2 is set as false.
set decimal_v2=false;
insert into table overflowed_decimal_tbl_1
select 4, cast(cast(654964569154.9565 as decimal (28,7))*44658554984*2.111
as decimal (28,10));
select count(*) from overflowed_decimal_tbl_1 where d_28 is null;
---- RESULTS
1
====
---- QUERY
# Verify that overflow behaviour of decimal_v1 is unchanged.
# Verify that decimal value, which is expressed with decimal expression with one
# alias and its value is overflowed, is inserted into the table as NULL when
# decimal_v2 is set as false.
set decimal_v2=false;
insert into table overflowed_decimal_tbl_1
select 5, cast(a*44658554984*2.111 as decimal (28,10)) from
(select cast(654964569154.9565 as decimal (28,7)) as a) q;
select count(*) from overflowed_decimal_tbl_1 where d_28 is null;
---- RESULTS
2
====
---- QUERY
# Verify that overflow behaviour of decimal_v1 is unchanged.
# Verify that decimal value, which is expressed with decimal expression with three
# alias and its value is overflowed, is inserted into the table as NULL when
# decimal_v2 is set as false.
set decimal_v2=false;
insert into table overflowed_decimal_tbl_1
select 6, cast(a*b*c as decimal (28,10)) from
(select cast(654964569154.9565 as decimal (28,7)) as a,
cast(44658554984 as decimal (28,7)) as b,
cast(2.111 as decimal (28,7)) as c) q;
select count(*) from overflowed_decimal_tbl_1 where d_28 is null;
---- RESULTS
3
====
---- QUERY
# Verify that decimal value, which is expressed with constant decimal expression
# and its value is overflowed, cause query aborted with an error.
set decimal_v2=true;
insert into table overflowed_decimal_tbl_1
select 7, cast(cast(654964569154.9565 as decimal (28,7))*44658554984*2.111
as decimal (28,10));
---- CATCH
Decimal expression overflowed
====
---- QUERY
# Verify that decimal value, which is expressed with decimal expression with one
# alias and its value is overflowed, cause query aborted with an error.
set decimal_v2=true;
insert into table overflowed_decimal_tbl_1
select 8, cast(a*44658554984*2.111 as decimal (28,10)) from
(select cast(654964569154.9565 as decimal (28,7)) as a) q;
---- CATCH
Decimal expression overflowed
====
---- QUERY
# Verify that decimal value, which is expressed with decimal expression with three
# aliases and its value is overflowed, cause query aborted with an error.
set decimal_v2=true;
insert into table overflowed_decimal_tbl_1
select 9, cast(a*b*c as decimal (28,10)) from
(select cast(654964569154.9565 as decimal (28,7)) as a,
cast(44658554984 as decimal (28,7)) as b,
cast(2.111 as decimal (28,7)) as c) q;
---- CATCH
Decimal expression overflowed
====
---- QUERY
# Verify that decimal value, which is expressed with selection from another table
# and its value is overflowed, cause query aborted with an error.
set decimal_v2=true;
insert into table overflowed_decimal_tbl_2
select i, cast(d_28*d_28*d_28 as decimal (28,10))
from overflowed_decimal_tbl_1 where d_28 is not null;
---- CATCH
Decimal expression overflowed
====