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-7744) Dropping the last collection column turns CompoundSparseCellNameType$WithCollection into CompoundDenseCellNameType
Date Tue, 12 Aug 2014 12:13:12 GMT

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

Sylvain Lebresne updated CASSANDRA-7744:
----------------------------------------

    Attachment: 7744.txt

This has to do with the detection of whether a table is dense or not. In this particular instance,
the problem is that for a table with no regular column (like is the case after the drop),
we base that "is dense" detection on the comparator: it's considered dense unless the comparator
is {{CompositeType(UTF8Type)}} because that is the comparator we except if you create a CQL
table with only a partition key. Except that, due to reasons explained in CASSANDRA-6276,
the comparator after the drop is {{CompositeType(UTF8Type, ColumnToCollectionType(...))}}
and hence the "detection" fails and the table is reported "dense", which is wrong.

But the more general problem is that this detection business is overly fragile for no reason.
At least for table created from CQL, we know at creation if the table should be dense or not,
and this should not change, so we should simply save that information (we should have done
that a long time ago tbh). So anyway, attaching a patch that does that and fix this particular
issue.


> Dropping the last collection column turns CompoundSparseCellNameType$WithCollection into
CompoundDenseCellNameType
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-7744
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7744
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Aleksey Yeschenko
>            Assignee: Sylvain Lebresne
>             Fix For: 2.0.10, 2.1.0
>
>         Attachments: 7744.txt
>
>
> Dropping the last collection column turns CompoundSparseCellNameType$WithCollection into
CompoundDenseCellNameType
> To reproduce
> {code}
> cqlsh:test> create table test (id int primary key, col map<int,int>);
> cqlsh:test> alter table test drop col;
> cqlsh:test> alter table test add col list<int>;
> code=2200 [Invalid query] message="Cannot add new column to a COMPACT STORAGE table"
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message