mirror of
https://github.com/apache/impala.git
synced 2026-01-06 06:01:03 -05:00
I used the following document for reference: http://www.tpc.org/tpch/spec/tpch2.1.0.pdf Change-Id: Ic84db0628323c90e89552707f214bbb9fa2f2ae0 Reviewed-on: http://gerrit.ent.cloudera.com:8080/3132 Reviewed-by: Ishaan Joshi <ishaan@cloudera.com> Tested-by: jenkins
19 lines
472 B
Plaintext
19 lines
472 B
Plaintext
====
|
|
---- QUERY: TPCH-Q17
|
|
select sum(l_extendedprice) / 7.0 as avg_yearly
|
|
from lineitem l
|
|
join part p
|
|
on (p.p_partkey = l.l_partkey)
|
|
join ( select l_partkey as t_partkey,
|
|
0.2 * avg(l_quantity) as t_avg_quantity
|
|
from lineitem group by l_partkey ) as lt
|
|
on (lt.t_partkey = p.p_partkey)
|
|
where
|
|
p.p_brand = 'Brand#23' and
|
|
p.p_container = 'MED BOX' and
|
|
l.l_quantity < lt.t_avg_quantity
|
|
---- RESULTS
|
|
348406.05
|
|
---- TYPES
|
|
decimal
|
|
==== |