Can a primary key in Cassandra contain a collection column? -
can primary key in cassandra contain collection column?
example:
create table person ( first_name text, emails set<text>, description text primary key (first_name, emails) );
collection types cannot part of primary key, , neither can counter type. can test yourself, reason might not obvious.
sets, list, maps hacks on top of storage model (but don’t mean in negative way). set number of columns same key prefix. part of primary key value must scalar, , collection types aren’t.
Comments
Post a Comment