mirror of
https://github.com/apache/impala.git
synced 2026-01-01 09:00:42 -05:00
The following changes are included in this commit: 1. Modified the alltypesagg table to include an additional partition key that has nulls. 2. Added a number of tests in hdfs.test that exercise the partition pruning logic (see IMPALA-887). 3. Modified all the tests that are affected by the change in alltypesagg. Change-Id: I1a769375aaa71273341522eb94490ba5e4c6f00d Reviewed-on: http://gerrit.ent.cloudera.com:8080/2874 Reviewed-by: Dimitris Tsirogiannis <dtsirogiannis@cloudera.com> Tested-by: jenkins Reviewed-on: http://gerrit.ent.cloudera.com:8080/3236
160 lines
2.4 KiB
Plaintext
160 lines
2.4 KiB
Plaintext
====
|
|
---- QUERY
|
|
select year, count(*) from alltypes group by 1 order by 1 limit 10
|
|
---- RESULTS
|
|
2009,3650
|
|
2010,3650
|
|
---- TYPES
|
|
INT, BIGINT
|
|
====
|
|
---- QUERY
|
|
select month, count(*) from alltypes group by 1 order by 1 limit 100
|
|
---- RESULTS
|
|
1,620
|
|
2,560
|
|
3,620
|
|
4,600
|
|
5,620
|
|
6,600
|
|
7,620
|
|
8,620
|
|
9,600
|
|
10,620
|
|
11,600
|
|
12,620
|
|
---- TYPES
|
|
INT, BIGINT
|
|
====
|
|
---- QUERY
|
|
select year, month, count(*) from alltypes group by 1, 2 order by 1, 2 limit 100
|
|
---- RESULTS
|
|
2009,1,310
|
|
2009,2,280
|
|
2009,3,310
|
|
2009,4,300
|
|
2009,5,310
|
|
2009,6,300
|
|
2009,7,310
|
|
2009,8,310
|
|
2009,9,300
|
|
2009,10,310
|
|
2009,11,300
|
|
2009,12,310
|
|
2010,1,310
|
|
2010,2,280
|
|
2010,3,310
|
|
2010,4,300
|
|
2010,5,310
|
|
2010,6,300
|
|
2010,7,310
|
|
2010,8,310
|
|
2010,9,300
|
|
2010,10,310
|
|
2010,11,300
|
|
2010,12,310
|
|
---- TYPES
|
|
INT, INT, BIGINT
|
|
====
|
|
---- QUERY
|
|
select count(*) from alltypes where year=2009
|
|
---- RESULTS
|
|
3650
|
|
---- TYPES
|
|
BIGINT
|
|
====
|
|
---- QUERY
|
|
# still works if 'year' needs a cast
|
|
select count(*) from alltypes where year = 2009.0
|
|
---- RESULTS
|
|
3650
|
|
---- TYPES
|
|
BIGINT
|
|
====
|
|
---- QUERY
|
|
# finds bindings for partition keys regardless of order of operands
|
|
select count(*) from alltypes where 2009 = year
|
|
---- RESULTS
|
|
3650
|
|
---- TYPES
|
|
BIGINT
|
|
====
|
|
---- QUERY
|
|
select count(*) from alltypes where 2009.0 = year
|
|
---- RESULTS
|
|
3650
|
|
---- TYPES
|
|
BIGINT
|
|
====
|
|
---- QUERY
|
|
select count(*) from alltypes where month=1
|
|
---- RESULTS
|
|
620
|
|
---- TYPES
|
|
BIGINT
|
|
====
|
|
---- QUERY
|
|
select count(*) from alltypes where year=2009 and month=1
|
|
---- RESULTS
|
|
310
|
|
---- TYPES
|
|
BIGINT
|
|
====
|
|
---- QUERY
|
|
select count(*) from alltypes where year=2009 and month > 6
|
|
---- RESULTS
|
|
1840
|
|
---- TYPES
|
|
BIGINT
|
|
====
|
|
---- QUERY
|
|
select count(*) from alltypes where year=2009 and month < 6
|
|
---- RESULTS
|
|
1510
|
|
---- TYPES
|
|
BIGINT
|
|
====
|
|
---- QUERY
|
|
select count(*) from alltypes where year<=2009 and month < 6
|
|
---- RESULTS
|
|
1510
|
|
---- TYPES
|
|
BIGINT
|
|
====
|
|
---- QUERY
|
|
select count(*) from alltypes where month < 9 and month > 6
|
|
---- RESULTS
|
|
1240
|
|
---- TYPES
|
|
BIGINT
|
|
====
|
|
---- QUERY
|
|
select count(*) from alltypes where year < 2010 and year < 2009 and month > 6
|
|
---- RESULTS
|
|
0
|
|
---- TYPES
|
|
BIGINT
|
|
====
|
|
---- QUERY
|
|
select count(*) from alltypes where year < 2010 and month > 6 and month > 12
|
|
---- RESULTS
|
|
0
|
|
---- TYPES
|
|
BIGINT
|
|
====
|
|
---- QUERY
|
|
# Test multi files partitioned table (hdfs)
|
|
select count(*) from alltypesaggmultifiles where day is not null
|
|
---- RESULTS
|
|
10000
|
|
---- TYPES
|
|
BIGINT
|
|
====
|
|
---- QUERY
|
|
# Test multi files partitioned table (text)
|
|
select count(*) from alltypesaggmultifiles where day is not null
|
|
---- RESULTS
|
|
10000
|
|
---- TYPES
|
|
BIGINT
|
|
====
|