Files
impala/testdata/workloads/functional-query/queries/QueryTest/virtual-column-file-position-generic.test
Daniel Becker 03c465dac1 IMPALA-11719: Inconsistency in printing NULL values
NULL values are printed as "NULL" if they are top level or in
collections, but as "null" in structs. We should print collections and
structs in JSON form, so it should be "null" in collections, too. Hive
also follows the latter (correct) approach.

This commit changes the printing of NULL values to "null" in
collections.

Testing:
 - Modified the tests to expect "null" instead of "NULL" in collections.

Change-Id: Ie5e7f98df4014ea417ddf73ac0fb8ec01ef655ba
Reviewed-on: http://gerrit.cloudera.org:8080/19236
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Reviewed-by: Daniel Becker <daniel.becker@cloudera.com>
2022-11-15 09:24:03 +00:00

158 lines
2.9 KiB
Plaintext

====
---- QUERY
select file__position, * from alltypestiny order by id;
---- RESULTS
0,0,true,0,0,0,0,0,0,'01/01/09','0',2009-01-01 00:00:00,2009,1
1,1,false,1,1,1,10,1.100000023841858,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
0,2,true,0,0,0,0,0,0,'02/01/09','0',2009-02-01 00:00:00,2009,2
1,3,false,1,1,1,10,1.100000023841858,10.1,'02/01/09','1',2009-02-01 00:01:00,2009,2
0,4,true,0,0,0,0,0,0,'03/01/09','0',2009-03-01 00:00:00,2009,3
1,5,false,1,1,1,10,1.100000023841858,10.1,'03/01/09','1',2009-03-01 00:01:00,2009,3
0,6,true,0,0,0,0,0,0,'04/01/09','0',2009-04-01 00:00:00,2009,4
1,7,false,1,1,1,10,1.100000023841858,10.1,'04/01/09','1',2009-04-01 00:01:00,2009,4
---- TYPES
BIGINT, INT, BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, STRING, STRING, TIMESTAMP, INT, INT
====
---- QUERY
select file__position, * from alltypestiny
where file__position = 1
order by id;
---- RESULTS
1,1,false,1,1,1,10,1.100000023841858,10.1,'01/01/09','1',2009-01-01 00:01:00,2009,1
1,3,false,1,1,1,10,1.100000023841858,10.1,'02/01/09','1',2009-02-01 00:01:00,2009,2
1,5,false,1,1,1,10,1.100000023841858,10.1,'03/01/09','1',2009-03-01 00:01:00,2009,3
1,7,false,1,1,1,10,1.100000023841858,10.1,'04/01/09','1',2009-04-01 00:01:00,2009,4
---- TYPES
BIGINT, INT, BOOLEAN, TINYINT, SMALLINT, INT, BIGINT, FLOAT, DOUBLE, STRING, STRING, TIMESTAMP, INT, INT
====
---- QUERY
select file__position, count(*) from alltypestiny
group by file__position;
---- RESULTS
1,4
0,4
---- TYPES
BIGINT, BIGINT
====
---- QUERY
select file__position, id from alltypestiny
order by id;
---- RESULTS
0,0
1,1
0,2
1,3
0,4
1,5
0,6
1,7
---- TYPES
BIGINT, INT
====
---- QUERY
select file__position from alltypestiny;
---- RESULTS
0
1
0
1
0
1
0
1
---- TYPES
BIGINT
====
---- QUERY
select max(file__position) from alltypestiny;
---- RESULTS
1
---- TYPES
BIGINT
====
---- QUERY
select file__position, id from complextypestbl
order by id;
---- RESULTS
0,1
1,2
2,3
3,4
4,5
5,6
6,7
0,8
---- TYPES
BIGINT, BIGINT
====
---- QUERY
select file__position, id, int_array from complextypestbl;
---- RESULTS
0,1,'[1,2,3]'
1,2,'[null,1,2,null,3,null]'
2,3,'[]'
3,4,'NULL'
4,5,'NULL'
5,6,'NULL'
6,7,'NULL'
0,8,'[-1]'
---- TYPES
BIGINT, BIGINT, STRING
====
---- QUERY
select file__position, id, item from complextypestbl c, c.int_array
order by id;
---- RESULTS
0,1,1
0,1,2
0,1,3
1,2,NULL
1,2,1
1,2,2
1,2,NULL
1,2,3
1,2,NULL
0,8,-1
---- TYPES
BIGINT, BIGINT, INT
====
---- QUERY
select file__position, id, item from complextypestbl c, c.int_array_array;
---- RESULTS
0,1,'[1,2]'
0,1,'[3,4]'
1,2,'[null,1,2,null]'
1,2,'[3,null,4]'
1,2,'[]'
1,2,'NULL'
2,3,'NULL'
6,7,'NULL'
6,7,'[5,6]'
0,8,'[-1,-2]'
0,8,'[]'
---- TYPES
BIGINT, BIGINT, STRING
====
---- QUERY
select file__position, id, i.item from complextypestbl c, c.int_array_array a, a.item i
order by id;
---- RESULTS
0,1,1
0,1,2
0,1,3
0,1,4
1,2,NULL
1,2,1
1,2,2
1,2,NULL
1,2,3
1,2,NULL
1,2,4
6,7,5
6,7,6
0,8,-1
0,8,-2
---- TYPES
BIGINT, BIGINT, INT
====