mirror of
https://github.com/apache/impala.git
synced 2026-01-02 12:00:33 -05:00
125 lines
1.8 KiB
Plaintext
125 lines
1.8 KiB
Plaintext
====
|
|
---- QUERY
|
|
# Test for selecting from table with null and empty strings.
|
|
select * from nulltable
|
|
---- 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
|
|
---- 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
|
|
---- 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
|
|
---- 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
|
|
---- 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
|
|
---- TYPES
|
|
int
|
|
---- RESULTS
|
|
0
|
|
1
|
|
123
|
|
2
|
|
3
|
|
4
|
|
NULL
|
|
NULL
|
|
NULL
|
|
NULL
|
|
NULL
|
|
NULL
|
|
====
|
|
---- QUERY
|
|
select str_col from tblwithraggedcolumns
|
|
---- 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 `functional`.`alltypes` `table_alias`
|
|
GROUP BY `default_int_col`
|
|
LIMIT 10
|
|
---- TYPES
|
|
int
|
|
---- RESULTS
|
|
0
|
|
7
|
|
3
|
|
9
|
|
4
|
|
6
|
|
1
|
|
5
|
|
2
|
|
8
|
|
====
|
|
---- QUERY
|
|
# Select from table with escape char that is same as delim char
|
|
SELECT * FROM escapechartesttable
|
|
---- TYPES
|
|
int, boolean
|
|
---- RESULTS
|
|
0,true
|
|
1,false
|
|
2,true
|
|
3,false
|
|
4,true
|
|
5,false
|
|
6,true
|
|
7,false
|
|
8,true
|
|
9,false
|
|
====
|