blob: 1c84ba8661a4746faf2ec69036093fcea7027350 [file] [log] [blame]
buyingyic73348c2012-11-02 00:31:31 +00001drop table IF EXISTS supplier;
2drop table IF EXISTS result;
3
4create external table supplier (S_SUPPKEY INT, S_NAME STRING, S_ADDRESS STRING, S_NATIONKEY INT, S_PHONE STRING, S_ACCTBAL DOUBLE, S_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/supplier';
5create table result (S_SUPPKEY INT, S_NAME STRING, S_ADDRESS STRING, S_NATIONKEY INT);
6
7select * from (select (2*s_suppkey), s_address, s_nationkey, s_name FROM supplier where S_SUPPKEY*2 < 20 union all select (2*s_suppkey), s_address, s_nationkey, s_name FROM supplier where S_SUPPKEY*2 > 50) t;