Files
impala/testdata/workloads/functional-query/queries/QueryTest/misc.test
Lenni Kuff ef48f65e76 Add test framework for running Impala query tests via Python
This is the first set of changes required to start getting our functional test
infrastructure moved from JUnit to Python. After investigating a number of
option, I decided to go with a python test executor named py.test
(http://pytest.org/). It is very flexible, open source (MIT licensed), and will
enable us to do some cool things like parallel test execution.

As part of this change, we now use our "test vectors" for query test execution.
This will be very nice because it means if load the "core" dataset you know you
will be able to run the "core" query tests (specified by --exploration_strategy
when running the tests).

You will see that now each combination of table format + query exec options is
treated like an individual test case. this will make it much easier to debug
exactly where something failed.

These new tests can be run using the script at tests/run-tests.sh
2014-01-08 10:46:50 -08:00

124 lines
1.9 KiB
Plaintext

====
---- QUERY
# Test for selecting from table with null and empty strings.
select * from nulltable$TABLE
---- TYPES
string, string, string, int, double
---- RESULTS
'a','','NULL',NULL,NULL
====
---- QUERY
select count(*),count(a),count(b),count(c),count(d),count(e) from nulltable$TABLE
---- TYPES
bigint, bigint, bigint, bigint, bigint, bigint
---- RESULTS
1,1,1,0,0,0
====
---- QUERY
# Test for selecting from table with '\' escape character with null and empty strings.
select * from nullescapedtable$TABLE
---- TYPES
string, string, string, int, double
---- RESULTS
'a','','NULL',NULL,NULL
====
---- QUERY
select count(*),count(a),count(b),count(c), count(d), count(e) from nullescapedtable$TABLE
---- TYPES
bigint, bigint, bigint, bigint, bigint, bigint
---- RESULTS
1,1,1,0,0,0
====
---- QUERY
# Test to select from table with additional columns at the end that are not in the
# schema and with missing columns
select * from tblwithraggedcolumns$TABLE
---- TYPES
string, int
---- RESULTS
'',NULL
'',NULL
'ColumnWithCarriageReturn',123
'NoDelimiter',0
'\r\r\n',NULL
'a',3
'at16bytes',NULL
'b',4
'c',NULL
'd',NULL
'foo',2
'hello',1
====
---- QUERY
select int_col from tblwithraggedcolumns$TABLE
---- TYPES
int
---- RESULTS
0
1
123
2
3
4
NULL
NULL
NULL
NULL
NULL
NULL
====
---- QUERY
select str_col from tblwithraggedcolumns$TABLE
---- TYPES
string
---- RESULTS
''
''
'ColumnWithCarriageReturn'
'NoDelimiter'
'\r\r\n'
'a'
'at16bytes'
'b'
'c'
'd'
'foo'
'hello'
====
---- QUERY
# Quoting test
SELECT `table_alias`.`int_col` AS `default_int_col`
FROM `default`.`alltypes` `table_alias`
GROUP BY `default_int_col`
LIMIT 10
---- TYPES
int
---- RESULTS
0
7
3
9
4
6
1
5
2
8
====
# Select from table with escape char that is same as delim char
SELECT * FROM escapechartesttable$TABLE
---- TYPES
int, boolean
---- RESULTS
0,true
1,false
2,true
3,false
4,true
5,false
6,true
7,false
8,true
9,false
====