10

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?

Dharun
  • 613
  • 8
  • 26

3 Answers3

13

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.

Dharun
  • 613
  • 8
  • 26
6

Tables that contain counters can only contain counters.

jbellis
  • 19,347
  • 2
  • 38
  • 47
0

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)

Community
  • 1
  • 1
Andremoniy
  • 34,031
  • 20
  • 135
  • 241