[ https://issues.apache.org/jira/browse/CASSANDRA-13186?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Benjamin Lerer updated CASSANDRA-13186: --------------------------------------- Status: Triage Needed (was: Awaiting Feedback) > Create index fails if the primary key is included, but docs claim it is > supported > --------------------------------------------------------------------------------- > > Key: CASSANDRA-13186 > URL: https://issues.apache.org/jira/browse/CASSANDRA-13186 > Project: Cassandra > Issue Type: Bug > Components: Legacy/CQL > Reporter: Ariel Weisberg > Assignee: Aleksandr Sorokoumov > Priority: Normal > > {noformat} > cqlsh:foo> CREATE TABLE users ( > ... userid text PRIMARY KEY, > ... first_name text, > ... last_name text, > ... emails set<text>, > ... top_scores list<int>, > ... todo map<timestamp, text> > ... ); > cqlsh:foo> create index bar on foo.users (userid, last_name); > InvalidRequest: Error from server: code=2200 [Invalid query] message="Cannot > create secondary index on partition key column userid" > {noformat} > {quote} > <beobal> yes, it's a bug in CreateIndexStatement. The check to enforce the PK > has only a single component is wrong > it considers each target in isolation, so it doesn't take into account that > you might be creating a custom index on a PK component + something else > {quote} > http://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlCreateIndex.html > {quote} > Cassandra supports creating an index on most columns, excluding counter > columns but including a clustering column of a compound primary key or on the > partition (primary) key itself. > {quote} -- This message was sent by Atlassian Jira (v8.3.4#803005) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org