Create a table in Cassandra 1.2 with CQL3 where column names will be created at runtime

大兔子大兔子 提交于 2019-12-06 16:41:08

You would use the compound primary key feature of CQL3:

CREATE TABLE foo (
  object_id int,
  version int,
  value int,
  PRIMARY KEY (object_id, version));

In CQL3, Table schema is fixed. So you can't really get dynamic column names. For that you have to switch to CQL2.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!