buyingyi | c73348c | 2012-11-02 00:31:31 +0000 | [diff] [blame^] | 1 | DROP TABLE IF EXISTS nation; |
2 | DROP TABLE IF EXISTS u1_gby; | ||||
3 | |||||
4 | -- create tables and load data | ||||
5 | create external table nation (N_NATIONKEY INT, N_NAME STRING, N_REGIONKEY INT, N_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' STORED AS TEXTFILE LOCATION '/tpch/nation'; | ||||
6 | create table u1_gby(col1 INT, col2 INT); | ||||
7 | |||||
8 | insert overwrite table u1_gby select N_REGIONKEY, count(1) | ||||
9 | from nation | ||||
10 | group by N_REGIONKEY | ||||
11 | order by N_REGIONKEY; |