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?
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.
Tables that contain counters can only contain counters.
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