Files
impala/testdata/workloads/functional-query/queries/QueryTest/chars.test
Tim Armstrong 579e33207b IMPALA-6368: make test_chars parallel
Previously it had to be executed serially because it modified tables in
the functional database.

This change separates out tests that use temporary tables and runs those
in a unique_database.

Testing:
Ran locally in a loop with parallelism of 4 for a while.

Change-Id: I2f62ede90f619b8cebbb1276bab903e7555d9744
Reviewed-on: http://gerrit.cloudera.org:8080/9022
Reviewed-by: Tim Armstrong <tarmstrong@cloudera.com>
Tested-by: Impala Public Jenkins
2018-01-19 09:55:52 +00:00

154 lines
3.8 KiB
Plaintext

====
---- QUERY
select (cast("xyzzzzz12" as char(-1)))
---- CATCH
Syntax error
====
---- QUERY
select count(*), count(cs), count(cl), count(vc) from chars_tiny
---- TYPES
bigint,bigint,bigint,bigint
---- RESULTS
9,8,8,8
====
---- QUERY
select * from chars_tiny where cs = cast('6a' as CHAR(2))
---- TYPES
char,char,string
---- RESULTS
'6a ','6b ','6c'
'6a ','6b ','6c'
====
---- QUERY
select count(*) from chars_tiny where vc != cast('5c' as varchar(3))
---- TYPES
bigint
---- RESULTS
7
====
---- QUERY
select count(*) from chars_tiny where cs != cast('a' as char(3))
---- TYPES
bigint
---- RESULTS
7
====
---- QUERY
select count(DISTINCT cs) from chars_tiny where vc = cast('5c' as varchar(10))
---- TYPES
bigint
---- RESULTS
1
====
---- QUERY
select count(DISTINCT cs) from chars_tiny where cs = cast('5a' as char(10))
---- TYPES
bigint
---- RESULTS
1
====
---- QUERY
select cs, count(cl) from chars_tiny group by cs having count(vc) > 1
---- TYPES
char, bigint
---- RESULTS
'6a ',2
====
---- QUERY
select A.cs from chars_tiny as A, chars_tiny as B where
cast(A.cs as char(1)) = cast(B.cl as char(1)) order by A.cs
---- TYPES
char
---- RESULTS
'1aaaa'
'2aaaa'
'3aaa '
'4aa '
'5a '
'6a '
'6a '
'6a '
'6a '
====
---- QUERY
# Regression test for IMPALA-1316
select A.vc from chars_tiny as A join chars_tiny using (vc) order by A.vc
---- TYPES
string
---- RESULTS
'1cccc'
'2cccccc'
'3ccc'
'4cc'
'5c'
'6c'
'6c'
'6c'
'6c'
'c'
====
---- QUERY
# Regression test for IMPALA-1322
select count(*) from chars_tiny as A, chars_tiny as B
where cast(A.cs as CHAR(1)) = cast(B.vc as CHAR(1));
---- TYPES
bigint
---- RESULTS
9
====
---- QUERY
select min(cs), max(vc), ndv(cl), ndv(vc), appx_median(cs), appx_median(vc)
from chars_tiny
---- TYPES
string, string, bigint, bigint, string, string
---- RESULTS
'1aaaa','c',7,7,'5a ','5c'
====
---- QUERY
# Regression test for IMPALA-1316
select t1.vc, COUNT(1) FROM chars_tiny t1 GROUP BY 1 ORDER BY t1.vc
---- TYPES
string, bigint
---- RESULTS
'1cccc',1
'2cccccc',1
'3ccc',1
'4cc',1
'5c',1
'6c',2
'c',1
'NULL',1
====
---- QUERY
# Regression test for IMPALA-1316
select t1.cl, COUNT(1) FROM chars_tiny t1 GROUP BY 1 ORDER BY t1.cl
---- TYPES
char, bigint
---- RESULTS
'1bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',1
'2bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb',1
'3bbbbb ',1
'4bbbb ',1
'5bbb ',1
'6b ',2
'b ',1
'NULL',1
====
---- QUERY
# Regression test for IMPALA-1344
select cs, LAST_VALUE(cs) OVER (ORDER BY cs rows between unbounded preceding and
current row) FROM chars_tiny;
---- TYPES
char, string
---- RESULTS
'1aaaa','1aaaa'
'2aaaa','2aaaa'
'3aaa ','3aaa '
'4aa ','4aa '
'5a ','5a '
'6a ','6a '
'6a ','6a '
'a ','a '
'NULL','NULL'
====