mirror of
https://github.com/apache/impala.git
synced 2026-01-02 12:00:33 -05:00
99 lines
1.6 KiB
Plaintext
99 lines
1.6 KiB
Plaintext
# 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
|
|
====
|
|
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
|
|
====
|
|
# 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
|
|
====
|
|
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
|
|
====
|
|
# 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
|
|
====
|
|
select int_col from tblwithraggedcolumns$TABLE
|
|
---- TYPES
|
|
int
|
|
---- RESULTS
|
|
0
|
|
1
|
|
123
|
|
2
|
|
3
|
|
4
|
|
NULL
|
|
NULL
|
|
NULL
|
|
NULL
|
|
NULL
|
|
NULL
|
|
====
|
|
select str_col from tblwithraggedcolumns$TABLE
|
|
---- TYPES
|
|
string
|
|
---- RESULTS
|
|
''
|
|
''
|
|
'ColumnWithCarriageReturn'
|
|
'NoDelimiter'
|
|
'\r\r\n'
|
|
'a'
|
|
'at16bytes'
|
|
'b'
|
|
'c'
|
|
'd'
|
|
'foo'
|
|
'hello'
|
|
====
|
|
# 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
|
|
====
|