[ 
https://issues.apache.org/jira/browse/CASSANDRA-7771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14706735#comment-14706735
 ] 

Aleksey Yeschenko commented on CASSANDRA-7771:
----------------------------------------------

So, this is a minor change, given all the groundwork already done. Not much to 
review, and mostly already covered by Sylvain's review novel (think returning 
an absent {{Optional}} of {{Collection}} instead of an empty {{Collection}}).

Minor nits here and there - mostly already handled in a wip branch.

Ultimately I only have one issue with this, and that is the way we handle 
creating duplicate indexes with a default name on the same column.

Before the change, we used to reject them (obviously):

{code}
cqlsh> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
'replication_factor': 1};
cqlsh> USE test;
cqlsh:test> CREATE TABLE test (pk int, col text, PRIMARY KEY(pk));
cqlsh:test> CREATE INDEX ON test(col);
cqlsh:test> CREATE INDEX ON test(col);
InvalidRequest: code=2200 [Invalid query] message="Index already existss"
{code}

Never mind that the exception message is written in parseltongue, this is the 
correct behaviour that we should preserve.

After these changes:

{code}
cqlsh> CREATE KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 
'replication_factor': 1};
cqlsh> USE test;
cqlsh:test> CREATE TABLE test (pk int, col text, PRIMARY KEY(pk));
cqlsh:test> CREATE INDEX ON test(col);
cqlsh:test> CREATE INDEX ON test(col);
cqlsh:test> CREATE INDEX ON test(col);
cqlsh:test> CREATE INDEX ON test(col);
cqlsh:test> CREATE INDEX ON test(col);
{code}

Just creates identical {{test.test_col_idx}}, {{test.test_col_idx_1}}, 
{{test.test_col_idx_2}}, etc.

> Allow multiple 2ndary index on the same column
> ----------------------------------------------
>
>                 Key: CASSANDRA-7771
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7771
>             Project: Cassandra
>          Issue Type: New Feature
>            Reporter: Sylvain Lebresne
>            Assignee: Sam Tunnicliffe
>              Labels: client-impacting
>             Fix For: 3.0 beta 1
>
>
> Currently, the code assumes that we'll only have one 2ndary index per column. 
> This has been reasonable so far but stop being it with CASSANDRA-6382 (you 
> might want to index multiple fields of the same UDT column) and 
> CASSANDRA-7458 (you may want to have one "normal" index an multiple 
> functional index for the same column). So we should consider removing that 
> assumption in the code, which is mainly 2 places:
> # in the schema: each ColumnDefinition only has infos for one index. This 
> part should probably be tackled in CASSANDRA-6717 so I'm marking this issue 
> as a follow-up of CASSANDRA-6717.
> # in the 2ndary index API: this is the part I'm suggesting we fix in this 
> issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to