Created
November 11, 2013 21:39
-
-
Save natbusa/7420906 to your computer and use it in GitHub Desktop.
Cassandra timeseries: a signal decomposition.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE KEYSPACE iot WITH replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 } ; | |
| USE iot; | |
| create table signals ( | |
| sid bigint, | |
| year int, | |
| month int, | |
| day int, | |
| hour int, | |
| min int, | |
| sec int, | |
| value float, | |
| PRIMARY KEY ( (sid, year, month, day, hour), min, sec ) | |
| ); | |
| INSERT INTO signals (sid,year,month,day,hour,min,sec,value) VALUES (1,2013,11,11,22,34,13,1.4); | |
| INSERT INTO signals (sid,year,month,day,hour,min,sec,value) VALUES (1,2013,11,11,22,37,28,1.6); | |
| INSERT INTO signals (sid,year,month,day,hour,min,sec,value) VALUES (1,2013,11,11,22,37,29,1.8); | |
| INSERT INTO signals (sid,year,month,day,hour,min,sec,value) VALUES (1,2013,11,11,23,34,13,2.0); | |
| SELECT * FROM signals where sid=1 AND year=2013 AND month=11 AND day=11 AND hour=22; | |
| SELECT * FROM signals where sid=1 AND year=2013 AND month=11 AND day=11 AND hour=23; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment