cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maxim Fridental <M.Friden...@immowelt.de>
Subject Handling historized data
Date Fri, 20 Jan 2017 16:59:07 GMT
Hi there,

having the table defined as

CREATE TABLE dbo.test (objid int, historydate timestamp, field varchar, primary key ((objid),
historydate))

and the historized data eg. like these:

objid | historydate                     | field |
-------+---------------------------------+-------
     1 | 2017-01-19 00:00:00.000000+0000 |   abc
     1 | 2017-01-20 00:00:00.000000+0000 |   def
     1 | 2017-01-21 00:00:00.000000+0000 |   ghj
     2 | 2017-01-20 00:00:00.000000+0000 |   ---

how is it possible to retrieve the value of "field" corresponding to the latest historydate
of its objid, which on or before some @givenDate? So for @givenDate = 2017-01-20 it must output

objid | historydate                     | field |
-------+---------------------------------+-------
     1 | 2017-01-20 00:00:00.000000+0000 |   def
     2 | 2017-01-20 00:00:00.000000+0000 |   ---


Essentially we want to know the value of the "field" for all objects on some particular given
timestamp. We are speaking here about up to 2 billion records in this table.

What would be the canonical way to organize and implement such functionality with Cassandra
3.9?


Thanks!
Maxim

Mime
View raw message