public class TPCHQuery3 extends Object
This program implements the following SQL equivalent:
SELECT
l_orderkey,
SUM(l_extendedprice*(1-l_discount)) AS revenue,
o_orderdate,
o_shippriority
FROM customer,
orders,
lineitem
WHERE
c_mktsegment = '[SEGMENT]'
AND c_custkey = o_custkey
AND l_orderkey = o_orderkey
AND o_orderdate < date '[DATE]'
AND l_shipdate > date '[DATE]'
GROUP BY
l_orderkey,
o_orderdate,
o_shippriority;
Compared to the original TPC-H query this version does not sort the result by revenue and orderdate.
Input files are plain text CSV files using the pipe character ('|') as field separator as generated by the TPC-H data generator which is available at [http://www.tpc.org/tpch/](a href="http://www.tpc.org/tpch/).
Usage:
TPCHQuery3 --lineitem <path> --customer <path> --orders <path> --output <path>
This example shows how to use: - case classes and case class field addressing - build-in aggregation functions
Modifier and Type | Class and Description |
---|---|
static class |
TPCHQuery3.Customer |
static class |
TPCHQuery3.Customer$ |
static class |
TPCHQuery3.Lineitem |
static class |
TPCHQuery3.Lineitem$ |
static class |
TPCHQuery3.Order |
static class |
TPCHQuery3.Order$ |
static class |
TPCHQuery3.ShippedItem |
static class |
TPCHQuery3.ShippedItem$ |
Constructor and Description |
---|
TPCHQuery3() |
public static void main(String[] args)
Copyright © 2014–2017 The Apache Software Foundation. All rights reserved.