mirror of
https://github.com/apache/impala.git
synced 2026-01-09 15:00:11 -05:00
IMPALA-11350 implemented the FILE__POSITION virtual column for Parquet files. This ticket does the same but for ORC files. Note, that for full ACID ORC tables there have already been an implementation of row__id that could simply be re-used for this ticket. Testing: - TestScannersVirtualColumns.test_virtual_column_file_position_generic is changed to run now on ORC as well. I don't think further testing is required as this functionality has already been there for row__id we just re-used it for FILE__POSITION. Change-Id: Ie8e951f73ceb910d64cd149192853a4a2131f79b Reviewed-on: http://gerrit.cloudera.org:8080/18909 Reviewed-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
158 lines
2.9 KiB
Plaintext
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
|
|
====
|