Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Cassandra 具有cql3的动态列_Cassandra_Cql - Fatal编程技术网

Cassandra 具有cql3的动态列

Cassandra 具有cql3的动态列,cassandra,cql,Cassandra,Cql,我读了一篇关于存储时间序列数据的文章 根据这篇文章,它应该创建宽行来存储一些时间序列。如图所示: 我创建了一个表: CREATE TABLE test.times ( id text, time timestamp, temperature text, PRIMARY KEY (id, time)); 并插入一些值: cqlsh> insert into test.times (id, time , temperature ) VALUES ( '1', '2013-04-03 07:0

我读了一篇关于存储时间序列数据的文章

根据这篇文章,它应该创建宽行来存储一些时间序列。如图所示: 我创建了一个表:

CREATE TABLE test.times ( id text, time timestamp, temperature text, PRIMARY KEY (id, time));
并插入一些值:

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');
我用
sstabledump
工具转储了我的时刻表。我下一次被甩了:

[
  {
    "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" }
        ]
      }
    ]
  }
]
正如我看到的,C*为每个新条目创建了新行。我做错了什么?如何使用CQL创建宽行

卡桑德拉五世。3.5你做得对。宽行实际上意味着宽分区。您可以看到您有包含多个逻辑
cql行的分区(由
id
标识)。这些分区是您想要的宽分区

C*3.0存储引擎的链接

  • 你做得对。宽行实际上意味着宽分区。您可以看到您有包含多个逻辑
    cql行的分区(由
    id
    标识)。这些分区是您想要的宽分区

    C*3.0存储引擎的链接


  • CQL中的行与Thrift中的列相同吗?在C*3.0中,这个问题实际上与存储系统被重新写入的情况无关。之前,您可以将
    cql行
    想象为一组相邻的单元,每个单元都有集群键值作为其“头”,并有一个不同的非主键列的值作为其值。看看新的存储格式吧,虽然现在真的没有类似的节约方式了。非常感谢!你能给一些关于C*3.x中数据存储模型的文章提些建议吗?CQL中的行是否与Thrift中的列相同?在C*3.0中,这个问题与存储系统被重新编写的地方并不相关。之前,您可以将
    cql行
    想象为一组相邻的单元,每个单元都有集群键值作为其“头”,并有一个不同的非主键列的值作为其值。看看新的存储格式吧,虽然现在真的没有类似的节约方式了。非常感谢!你能给我一些关于C*3.x中数据存储模型的文章吗?