I read Datastax article about storing time series data https://academy.datastax.com/resources/getting-started-time-series-data-modeling
According article it should create wide rows for storing some time series. Like this(pic from article):
I created table:
CREATE TABLE test.times ( id text, time timestamp, temperature text, PRIMARY KEY (id, time));
And insert some values:
cqlsh> insert into test.times (id, time , temperature ) VALUES ( '1', '2013-04-03 07:03:00', '72F');
cqlsh> insert into test.times (id, time , temperature ) VALUES ( '1', '2013-04-03 07:03:01', '73F');
cqlsh> insert into test.times (id, time , temperature ) VALUES ( '1', '2013-04-03 07:03:02', '74F');
cqlsh> insert into test.times (id, time , temperature ) VALUES ( '2', '2013-04-03 07:04:02', '74F');
cqlsh> insert into test.times (id, time , temperature ) VALUES ( '2', '2013-04-03 07:04:03', '72F');
And I made dump of my times table using sstabledump
tool. And I got next dump:
[
{
"partition" : {
"key" : [ "2" ],
"position" : 0
},
"rows" : [
{
"type" : "row",
"position" : 15,
"clustering" : [ "2013-04-03 07:04+0200" ],
"liveness_info" : { "tstamp" : 1463419324694096 },
"cells" : [
{ "name" : "temperature", "value" : "74F" }
]
},
{
"type" : "row",
"position" : 36,
"clustering" : [ "2013-04-03 07:04+0200" ],
"liveness_info" : { "tstamp" : 1463419332655070 },
"cells" : [
{ "name" : "temperature", "value" : "72F" }
]
}
]
},
{
"partition" : {
"key" : [ "1" ],
"position" : 58
},
"rows" : [
{
"type" : "row",
"position" : 73,
"clustering" : [ "2013-04-03 07:03+0200" ],
"liveness_info" : { "tstamp" : 1463419298628467 },
"cells" : [
{ "name" : "temperature", "value" : "72F" }
]
},
{
"type" : "row",
"position" : 91,
"clustering" : [ "2013-04-03 07:03+0200" ],
"liveness_info" : { "tstamp" : 1463419310835537 },
"cells" : [
{ "name" : "temperature", "value" : "73F" }
]
},
{
"type" : "row",
"position" : 112,
"clustering" : [ "2013-04-03 07:03+0200" ],
"liveness_info" : { "tstamp" : 1463419317481809 },
"cells" : [
{ "name" : "temperature", "value" : "74F" }
]
}
]
}
]
As I saw C* created new row for every new entry. What I'm doing wrong? And how can I create wide row using CQL?
Cassandra v. 3.5