Skip to content

Instantly share code, notes, and snippets.

@nivdul
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nivdul/88d1dbb944f75c8bf612 to your computer and use it in GitHub Desktop.
Save nivdul/88d1dbb944f75c8bf612 to your computer and use it in GitHub Desktop.
Cassandra cql requests
CREATE KEYSPACE actitracker WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1 };
CREATE TABLE users (user_id int,activity text,timestamp bigint,acc_x double,acc_y double,acc_z double, PRIMARY KEY ((user_id,activity),timestamp));
COPY users FROM '/path_to_your_data/data.csv' WITH HEADER = true;
SELECT * FROM users WHERE user_id = 8 AND activity = 'Standing' LIMIT 10;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment