Re: Storing bi-temporal data in Cassandra

2015-02-20 Thread Peter Lin
I think I get the basics of what you want to achieve. Side note, the sample insert seems to have a typo for the transaction time For the first query, I would store the data using weatherstation _id as the key. The create table statement might look like this. CREATE TABLE weatherstation ( weathers

Re: Storing bi-temporal data in Cassandra

2015-02-20 Thread Raj N
Thanks for the response Peter. I used the temperature table because its the most common example on CQL timeseries and I thought I would reuse it. From some of the responses, looks like I was wrong. event_time is the time the event happened. So yes it is valid time. I was trying to see if I can get

Re: Storing bi-temporal data in Cassandra

2015-02-15 Thread Peter Lin
I've built several different bi-temporal databases over the year for a variety of applications, so I have to ask "why are you modeling it this way?" Having a temperatures table doesn't make sense to me. Normally a bi-temporal database has transaction time and valid time. The transaction time is th

Re: Storing bi-temporal data in Cassandra

2015-02-15 Thread Jack Krupansky
I had forgotten, but there is a new tuple notation to iterate over more than one clustering column in C* 2.0.6: https://issues.apache.org/jira/browse/CASSANDRA-4851 For example, SELECT ... WHERE (c1, c2) > (1, 0) There's an example in the CQL spec: https://cassandra.apache.org/doc/cql3/CQL.html

Re: Storing bi-temporal data in Cassandra

2015-02-15 Thread Jack Krupansky
The simple, easy way to look at this is that you can use a range when the data will be contiguous.Only by allowing only the last clustering column to use a range can Cassandra be assured that the rows selected by the range will be contiguous (a "slice.") The point is that Cassandra is designed for

Re: Storing bi-temporal data in Cassandra

2015-02-15 Thread Dave Brosius
As you point out, there's not really a node-based problem with your query from a performance point of view. This is a limitation of CQL in that, cql wants to slice one section of a partition's row (no matter how big the section is). In your case, you are asking to slice multiple sections of a p

Re: Storing bi-temporal data in Cassandra

2015-02-15 Thread Laing, Michael
Perhaps you should learn more about Cassandra before you ask such questions. It's easy if you just look at the readily accessible docs. ml On Sat, Feb 14, 2015 at 6:05 PM, Raj N wrote: > I don't think thats solves my problem. The question really is why can't we > use ranges for both time colum

Re: Storing bi-temporal data in Cassandra

2015-02-14 Thread Raj N
I don't think thats solves my problem. The question really is why can't we use ranges for both time columns when they are part of the primary key. They are on 1 row after all. Is this just a CQL limitation? -Raj On Sat, Feb 14, 2015 at 3:35 AM, DuyHai Doan wrote: > "I am trying to get the state

Re: Storing bi-temporal data in Cassandra

2015-02-14 Thread DuyHai Doan
"I am trying to get the state as of a particular transaction_time" --> In that case you should probably define your primary key in another order for clustering columns PRIMARY KEY (weatherstation_id,transaction_time,event_time) Then, select * from temperatures where weatherstation_id = 'foo' an

Storing bi-temporal data in Cassandra

2015-02-13 Thread Raj N
Has anyone designed a bi-temporal table in Cassandra? Doesn't look like I can do this using CQL for now. Taking the time series example from well known modeling tutorials in Cassandra - CREATE TABLE temperatures ( weatherstation_id text, event_time timestamp, temperature text, PRIMARY KEY (weather