mirror of
https://github.com/apache/impala.git
synced 2026-01-01 00:00:20 -05:00
Our .test file parser used to not abort tests when there is a malformed test/section. This patch changes that behavior to report an error and treat the test as failed. Quite a few tests were not well-formed, and were not executed as a result. This patch fixes those tests. Arguably, the test file parser should be more flexible in which places to accept comments, but this patch does not address that problem. Change-Id: If53358eb0cb958b68e51940b071e64c1d6c3ec6f Reviewed-on: http://gerrit.sjc.cloudera.com:8080/5468 Reviewed-by: Alex Behm <alex.behm@cloudera.com> Tested-by: jenkins
73 lines
1.5 KiB
Plaintext
73 lines
1.5 KiB
Plaintext
====
|
|
---- QUERY
|
|
values(1, 2+1, 1.0, 5.0 + 1.0, 'a')
|
|
---- RESULTS
|
|
1,3,1.0,6.0,'a'
|
|
---- TYPES
|
|
TINYINT, SMALLINT, DECIMAL, DECIMAL, STRING
|
|
====
|
|
---- QUERY
|
|
values(1+1, 2, 5.0, 'a') order by 1 limit 10
|
|
---- RESULTS
|
|
2,2,5.0,'a'
|
|
---- TYPES
|
|
SMALLINT, TINYINT, DECIMAL, STRING
|
|
====
|
|
---- QUERY
|
|
values((1+8, 2, 5.0, 'a'), (2, 3, 6.0, 'b'), (3, 4, 7.0, 'c'))
|
|
---- RESULTS
|
|
9,2,5.0,'a'
|
|
2,3,6.0,'b'
|
|
3,4,7.0,'c'
|
|
---- TYPES
|
|
SMALLINT, TINYINT, DECIMAL, STRING
|
|
====
|
|
---- QUERY
|
|
values((1+8, 2, 5.0, 'a'), (2, 3, 6.0, 'b'), (3, 4, 7.0, 'c')) order by 1 desc limit 2
|
|
---- RESULTS
|
|
9,2,5.0,'a'
|
|
3,4,7.0,'c'
|
|
---- TYPES
|
|
SMALLINT, TINYINT, DECIMAL, STRING
|
|
====
|
|
---- QUERY
|
|
# Test literal casts by inserting into a table that requires a float.
|
|
drop table if exists values_test_float_tbl;
|
|
create table values_test_float_tbl(f float);
|
|
insert overwrite values_test_float_tbl values
|
|
(1), (16), (1024), (65536), (1000000), (1.1), (98.6), (0.07), (33.333);
|
|
select * from values_test_float_tbl;
|
|
---- RESULTS
|
|
1
|
|
16
|
|
1024
|
|
65536
|
|
1000000
|
|
1.100000023841858
|
|
98.59999847412109
|
|
0.07
|
|
33.33300018310547
|
|
---- TYPES
|
|
float
|
|
====
|
|
---- QUERY
|
|
# Test literal casts by inserting into a table that requires a decimal.
|
|
drop table if exists values_test_decimal_tbl;
|
|
create table values_test_decimal_tbl(f decimal(20, 4));
|
|
insert overwrite values_test_decimal_tbl values
|
|
(1), (16), (1024), (65536), (1000000), (1.1), (98.6), (0.07), (33.333);
|
|
select * from values_test_decimal_tbl;
|
|
---- RESULTS
|
|
1.0000
|
|
16.0000
|
|
1024.0000
|
|
65536.0000
|
|
1000000.0000
|
|
1.1000
|
|
98.6000
|
|
0.0700
|
|
33.3330
|
|
---- TYPES
|
|
decimal
|
|
====
|