[ https://issues.apache.org/jira/browse/CASSANDRA-6160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14295654#comment-14295654 ]
Nicolas Favre-Felix commented on CASSANDRA-6160: ------------------------------------------------ Unfortunately this breaks secondary indexes on primary key dimensions: {code} cqlsh:ks1> create table test3 (col1 int, col2 int, col3 counter, primary key((col1, col2))); cqlsh:ks1> update test3 set col3 = col3 + 3 where col1 = 1 and col2 = 2; cqlsh:ks1> select * from test3; col1 | col2 | col3 ------+------+------ 1 | 2 | 3 (1 rows) cqlsh:ks1> create index expected on test3(col2); Bad Request: Secondary indexes are not supported on counter tables {code} With RMW counters, we should be able to add both the counter write and the secondary index update in the same commit log entry. I couldn't find a JIRA for this; is there one? > Throw errror when attempting to create a secondary index against counter > ------------------------------------------------------------------------ > > Key: CASSANDRA-6160 > URL: https://issues.apache.org/jira/browse/CASSANDRA-6160 > Project: Cassandra > Issue Type: Bug > Components: API > Reporter: Adam Hattrell > Assignee: Sylvain Lebresne > Priority: Minor > Fix For: 1.2.11 > > Attachments: 6160.txt > > > Using CQL you can create a secondary index against a counter which is then > non-functional. > {code} > cqlsh:test> create table test2 (col1 int, col2 counter, primary key (col1)) ; > cqlsh:test> create index dodgy on test2(col2) ; > cqlsh:test> update test2 set col2 = col2 + 0 where col1 = 1 ; > cqlsh:test> select * from test2 ; > col1 | col2 > ------+------ > 1 | 0 > cqlsh:t7088> select * from test2 where col2 = 0 ; > {code} > We should return an error to let users know they are in unsupported territory. -- This message was sent by Atlassian JIRA (v6.3.4#6332)