Cassandra Non-Counter Family

旧巷老猫 提交于 2019-12-06 20:43:12

问题


I'm attempted to execute the following CQL 3 statement

 CREATE TABLE summary (
                id uuid,
                "client" bigint, 
                "campaign" text, 
                "unit" bigint,
                "view" counter,
                PRIMARY KEY ("client", "campaign", "unit"));

The error I'm getting is that I cannot create a counter column on a non-counter column family.

Any ideas?


回答1:


The solution to this issue is that any non-counter column must be part of the primary key. The column id uuid was the one causing the issue, removing it allowed the table to be created.




回答2:


Tables that contain counters can only contain counters.




回答3:


That's a limitation of the current counter implementation. You can't mix counters and regular columns in the same table. So you need a separate table for counters.

They are thinking of removing this limitation in Cassandra 3.x. See this Jira ticket.

(migrated from Cassandra non counter family)



来源:https://stackoverflow.com/questions/19596618/cassandra-non-counter-family

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