Files
impala/testdata/workloads/tpch/queries/tpch-q3.test
ishaan 2b5df0c6ff [CDH5] Convert tpch schemas to decimal and change the queries where possible.
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
2014-07-08 14:51:43 -07:00

38 lines
892 B
Plaintext

====
---- QUERY: TPCH-Q3
# Q3 - Shipping Priority Query
select
l_orderkey,
sum(l_extendedprice * (1 - l_discount)) as revenue,
o_orderdate,
o_shippriority
from lineitem l
join orders o
on (l.l_orderkey = o.o_orderkey)
join customer c
on (c.c_mktsegment = 'BUILDING' and c.c_custkey = o.o_custkey)
where
o_orderdate < '1995-03-15' and
l_shipdate > '1995-03-15'
group by
l_orderkey,
o_orderdate,
o_shippriority
order by
revenue desc,
o_orderdate
limit 10
---- RESULTS
2456423,406181.0111,'1995-03-05',0
3459808,405838.6989,'1995-03-04',0
492164,390324.0610,'1995-02-19',0
1188320,384537.9359,'1995-03-09',0
2435712,378673.0558,'1995-02-26',0
4878020,378376.7952,'1995-03-12',0
5521732,375153.9215,'1995-03-13',0
2628192,373133.3094,'1995-02-22',0
993600,371407.4595,'1995-03-05',0
2300070,367371.1452,'1995-03-13',0
---- TYPES
BIGINT, DECIMAL, STRING, INT
====