cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-8156) Fix validation of indexes on composite column components of COMPACT tables
Date Fri, 07 Nov 2014 10:10:33 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-8156?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Sylvain Lebresne updated CASSANDRA-8156:
----------------------------------------
    Attachment: 8156.txt

There is a bug here and it's that the index creation above is at all allowed since we don't
currently support indexes on primary key columns for compact tables. This is a validation
bug and I we should fix that asap, so attaching a patch for that.

Now, I know the initial intent of this ticket was to extend primary key column index support
for compact tables but to be honest, compact tables are mainly for legacy compatibility with
thrift tables, so I'm not convinced it's worth spending efforts and adding complexity for
it.

> Fix validation of indexes on composite column components of COMPACT tables
> --------------------------------------------------------------------------
>
>                 Key: CASSANDRA-8156
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-8156
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Denis Angilella
>            Assignee: Sylvain Lebresne
>             Fix For: 2.0.12
>
>         Attachments: 8156.txt
>
>
> CASSANDRA-5125 added support of indexes on composite column components for *non-compact*
tables (see CASSANDRA-5125 comments for additional information).
> This is a follow up for *compact* tables.
> Using compact tables it is possible to CREATE INDEX on composite primary key columns,
but queries returns no results for the tests below.
> {code:sql}
> CREATE TABLE users2 (
>    userID uuid,
>    fname text,
>    zip int,
>    state text,
>   PRIMARY KEY ((userID, fname))
> ) WITH COMPACT STORAGE;
> CREATE INDEX ON users2 (userID);
> CREATE INDEX ON users2 (fname);
> INSERT INTO users2 (userID, fname, zip, state) VALUES (b3e3bc33-b237-4b55-9337-3d41de9a5649,
'John', 10007, 'NY');
> -- the following queries returns 0 rows, instead of 1 expected
> SELECT * FROM users2 WHERE fname='John'; 
> SELECT * FROM users2 WHERE userid=b3e3bc33-b237-4b55-9337-3d41de9a5649;
> SELECT * FROM users2 WHERE userid=b3e3bc33-b237-4b55-9337-3d41de9a5649 AND fname='John';
> -- dropping 2ndary indexes restore normal behavior
> {code}



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

Mime
View raw message