madhusudancs@gmail.com | e581734 | 2013-03-15 08:26:56 +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; |