在Cassandra Column Family中定义dataTypes

时间:2013-04-22 10:06:20

标签: database-design nosql cassandra

create column family testing
  with key_validation_class = 'SomeType1'
  and comparator = 'SomeType2'
  and default_validation_class = 'SomeType3'

这一行代表了什么?

set testing[a][b] = c

我的观点是否正确?

a is of type SomeType1 
SomeType2 is how columns are sorted / sliced.
c is of type SomeType3

我的目标是创建一个包含时间序列数据的商店

testing[a][b] = c;
a is of type 'String' or 'UTF8Type'
b is 'LongType'
c is 'FloatType'

我应该能够做到

set testing['stats.randomNumber'][123456789] = 0.56;
set testing['stats.randomNumber'][123456790] = 90.33;

1 个答案:

答案 0 :(得分:0)

在你的cassandra-cli声明中set testing[a][b] = c

a代表您的rowkey

b代表您的专栏名称

c代表您的列值

有关cassandra-cli的进一步说明,请参阅Cassandra Documentation