CREATE EXTERNAL TABLE IF NOT EXISTS filecounts (
  word STRING,
  num INT)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS TEXTFILE
LOCATION '/output/pride';

CREATE TABLE IF NOT EXISTS orccounts (
  word STRING,
  num INT)
ROW FORMAT DELIMITED
FIELDS TERMINATED BY ','
STORED AS ORC;

INSERT OVERWRITE TABLE orccounts SELECT * FROM filecounts;

SELECT * FROM orccounts
ORDER BY num DESC
LIMIT 25;
