blob: b268affff5de48822508438d62f1e42ebf79b225 [file] [log] [blame]
buyingyic73348c2012-11-02 00:31:31 +00001drop table IF EXISTS orders;
2drop table IF EXISTS result;
3drop table IF EXISTS q_limit2;
4
5create 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';
6create table q_limit2(col1 int, col2 double, col3 string, col4 string);
7
8insert overwrite table q_limit2 select O_ORDERKEY, O_TOTALPRICE, O_ORDERDATE, O_CLERK from orders where O_TOTALPRICE<10000 order by o_totalprice limit 4;