blob: 1d901c2143ac963fa0fb761254059af9c150d6f7 [file] [log] [blame]
buyingyic73348c2012-11-02 00:31:31 +00001DROP TABLE IF EXISTS orders;
2DROP TABLE IF EXISTS customer;
3DROP TABLE IF EXISTS u10_join;
4
5-- create the tables and load the data
6create external table orders (O_ORDERKEY INT, O_CUSTKEY INT, O_ORDERSTATUS STRING, O_TOTALPRICE DOUBLE, O_ORDERDATE STRING, O_ORDERPRIORITY STRING, O_CLERK STRING, O_SHIPPRIORITY INT, O_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/orders';
7create external table customer (C_CUSTKEY INT, C_NAME STRING, C_ADDRESS STRING, C_NATIONKEY INT, C_PHONE STRING, C_ACCTBAL DOUBLE, C_MKTSEGMENT STRING, C_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/customer';
8
9create table u10_join(O_ORDERSTATUS STRING);
10
11insert overwrite table u10_join
12select O_TOTALPRICE
13from orders join customer
14on orders.O_CUSTKEY=customer.C_CUSTKEY
15order by O_TOTALPRICE;