Skip to content

Instantly share code, notes, and snippets.

@mioalter
Created September 23, 2013 21:28
Show Gist options
  • Save mioalter/6677207 to your computer and use it in GitHub Desktop.
Save mioalter/6677207 to your computer and use it in GitHub Desktop.
CREATE TABLE IF NOT EXISTS normalized (
gram string,
year int,
occurrences bigint
);
INSERT OVERWRITE TABLE normalized
SELECT
lower(gram),
year,
occurrences
FROM
ngrams
WHERE
year >= (${hiveconf:min_year} - 1) AND
year <= ${hiveconf:max_year} AND
gram REGEXP "^[A-Za-z+'-]{3,}$";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment