Skip to content

Instantly share code, notes, and snippets.

@mfelsche
Created December 4, 2014 16:38
Show Gist options
  • Save mfelsche/4b78602f58a43b14c5b1 to your computer and use it in GitHub Desktop.
Save mfelsche/4b78602f58a43b14c5b1 to your computer and use it in GitHub Desktop.
-- users
DROP TABLE users;
CREATE TABLE users (
username STRING PRIMARY KEY,
name STRING,
address STRING INDEX USING FULLTEXT,
date_of_birth TIMESTAMP,
date_joined TIMESTAMP,
month_partition STRING PRIMARY KEY
) CLUSTERED INTO 4 shards
PARTITIONED BY (month_partition)
WITH (number_of_replicas = 0, refresh_interval = 0);
-- steps
DROP TABLE steps;
CREATE TABLE steps (
username STRING,
ts TIMESTAMP,
num_steps INTEGER,
month_partition STRING,
payload OBJECT(dynamic)
) CLUSTERED BY (username) INTO 4 shards
PARTITIONED BY (month_partition)
WITH (number_of_replicas = 0, refresh_interval = 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment