Reputation: 1437
In CQL code I'm maintaining (author not available), I find a Cassandra table declaration that says, in part
PRIMARY KEY ((k1), k2, k3)
Do those inner parens mean anything in this case? Or is it merely redundant?
To clarify:
PRIMARY KEY (k1, k2, k3)
would mean (partition on k1, cluster on k2 and k3).PRIMARY KEY ((k1, k2), k3)
would mean (partition on (k1, k2), cluster on k3)Upvotes: 1
Views: 151
Reputation: 57758
Yes, PRIMARY KEY ((k1), k2, k3)
is basically the same as PRIMARY KEY (k1, k2, k3)
. In the case of designating a single partition key, you can opt to not specify the partition parens. They are really only necessary if you are creating a composite partition key (like you are with your point #2).
Upvotes: 3