Skip to content

Instantly share code, notes, and snippets.

@bradhe
Last active August 29, 2015 14:00
Show Gist options
  • Save bradhe/11126047 to your computer and use it in GitHub Desktop.
Save bradhe/11126047 to your computer and use it in GitHub Desktop.
CREATE TABLE facts (
dimension1 STRING,
dimension3 STRING,
dimension4 STRING,
timestamp2 TIMESTAMP,
measure1 DECIMAL,
measure2 DECIMAL,
measure3 DECIMAL
) PARTITIONED BY(dimension2 STRING, timestamp1 TIMESTAMP)
CLUSTERED BY(dimension1) INTO 32 BUCKETS;
INSERT INTO TABLE facts PARTITION (dimension2, timestamp1) SELECT dimension1, dimension3, dimension4, timestamp2, measure1, measure2, measure3 FROM raw_facts;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment