[jira] [Commented] (CASSANDRA-6276) CQL: Map can not be created with the same name as a previously dropped list

2016-09-19 Thread Aleksey Yeschenko (JIRA)

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

Aleksey Yeschenko commented on CASSANDRA-6276:
--

Dirty but also unsafe. There is a reason the limitation is there in the first 
place - try to 'work around it' and risk corruption.

> CQL: Map can not be created with the same name as a previously dropped list
> ---
>
> Key: CASSANDRA-6276
> URL: https://issues.apache.org/jira/browse/CASSANDRA-6276
> Project: Cassandra
>  Issue Type: Bug
> Environment:  Cassandra 2.0.2 | CQL spec 3.1.0
> centos 64 bit
> Java(TM) SE Runtime Environment (build 1.7.0-b147)
>Reporter: Oli Schacher
>Assignee: Benjamin Lerer
>Priority: Minor
>  Labels: cql
> Fix For: 2.0.10
>
> Attachments: 6272-2.0.txt, CASSANDRA-6276-V2.txt, CASSANDRA-6276.txt
>
>
> If create a list, drop it and create a map with the same name, i get "Bad 
> Request: comparators do not match or are not compatible."
> {quote}
> cqlsh:os_test1> create table thetable(id timeuuid primary key, somevalue 
> text);
> cqlsh:os_test1> alter table thetable add mycollection list;  
> cqlsh:os_test1> alter table thetable drop mycollection;
> cqlsh:os_test1> alter table thetable add mycollection map;  
> Bad Request: comparators do not match or are not compatible.
> {quote}



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


[jira] [Commented] (CASSANDRA-6276) CQL: Map can not be created with the same name as a previously dropped list

2016-08-04 Thread Mahafuzur Rahman (JIRA)

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

Mahafuzur Rahman commented on CASSANDRA-6276:
-

Facing the same problem in cassandra v3.7. Btw, it works when you drop the 
column, recreate a non collection column such as int with the same name and 
then drop that again. After that you can add the same name column with a 
different collection type and cassandra allows the operation. Dirty workaround 
though!

> CQL: Map can not be created with the same name as a previously dropped list
> ---
>
> Key: CASSANDRA-6276
> URL: https://issues.apache.org/jira/browse/CASSANDRA-6276
> Project: Cassandra
>  Issue Type: Bug
> Environment:  Cassandra 2.0.2 | CQL spec 3.1.0
> centos 64 bit
> Java(TM) SE Runtime Environment (build 1.7.0-b147)
>Reporter: Oli Schacher
>Assignee: Benjamin Lerer
>Priority: Minor
>  Labels: cql
> Fix For: 2.0.10
>
> Attachments: 6272-2.0.txt, CASSANDRA-6276-V2.txt, CASSANDRA-6276.txt
>
>
> If create a list, drop it and create a map with the same name, i get "Bad 
> Request: comparators do not match or are not compatible."
> {quote}
> cqlsh:os_test1> create table thetable(id timeuuid primary key, somevalue 
> text);
> cqlsh:os_test1> alter table thetable add mycollection list;  
> cqlsh:os_test1> alter table thetable drop mycollection;
> cqlsh:os_test1> alter table thetable add mycollection map;  
> Bad Request: comparators do not match or are not compatible.
> {quote}



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


[jira] [Commented] (CASSANDRA-6276) CQL: Map can not be created with the same name as a previously dropped list

2014-08-11 Thread Aleksey Yeschenko (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-6276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14092897#comment-14092897
 ] 

Aleksey Yeschenko commented on CASSANDRA-6276:
--

2.0 patch LGTM

 CQL: Map can not be created with the same name as a previously dropped list
 ---

 Key: CASSANDRA-6276
 URL: https://issues.apache.org/jira/browse/CASSANDRA-6276
 Project: Cassandra
  Issue Type: Bug
 Environment:  Cassandra 2.0.2 | CQL spec 3.1.0
 centos 64 bit
 Java(TM) SE Runtime Environment (build 1.7.0-b147)
Reporter: Oli Schacher
Assignee: Benjamin Lerer
Priority: Minor
  Labels: cql
 Fix For: 2.0.10

 Attachments: 6272-2.0.txt, CASSANDRA-6276-V2.txt, CASSANDRA-6276.txt


 If create a list, drop it and create a map with the same name, i get Bad 
 Request: comparators do not match or are not compatible.
 {quote}
 cqlsh:os_test1 create table thetable(id timeuuid primary key, somevalue 
 text);
 cqlsh:os_test1 alter table thetable add mycollection listtext;  
 cqlsh:os_test1 alter table thetable drop mycollection;
 cqlsh:os_test1 alter table thetable add mycollection maptext,text;  
 Bad Request: comparators do not match or are not compatible.
 {quote}



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


[jira] [Commented] (CASSANDRA-6276) CQL: Map can not be created with the same name as a previously dropped list

2014-08-04 Thread Sylvain Lebresne (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-6276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14084912#comment-14084912
 ] 

Sylvain Lebresne commented on CASSANDRA-6276:
-

You're right, I'm not sure there is much we can do about this.

bq. So the best we can do is provide a better exception message, unfortunately.

I agree. Let's detect that case and provide a meaningful error message for now.

In the longer run, one way to maybe fix this would be to push dropped_columns 
down to the sstable reading level. If we were skipping cells as soon as they 
are deserialized before they ever hit any comparator we would be free to update 
the comparator. Probably messy/inefficient to do with the current code, but 
might become feasible with 3.0 storage engine changes, we'll see. 

 CQL: Map can not be created with the same name as a previously dropped list
 ---

 Key: CASSANDRA-6276
 URL: https://issues.apache.org/jira/browse/CASSANDRA-6276
 Project: Cassandra
  Issue Type: Bug
 Environment:  Cassandra 2.0.2 | CQL spec 3.1.0
 centos 64 bit
 Java(TM) SE Runtime Environment (build 1.7.0-b147)
Reporter: Oli Schacher
Assignee: Benjamin Lerer
Priority: Minor
  Labels: cql
 Fix For: 2.1.1

 Attachments: CASSANDRA-6276.txt


 If create a list, drop it and create a map with the same name, i get Bad 
 Request: comparators do not match or are not compatible.
 {quote}
 cqlsh:os_test1 create table thetable(id timeuuid primary key, somevalue 
 text);
 cqlsh:os_test1 alter table thetable add mycollection listtext;  
 cqlsh:os_test1 alter table thetable drop mycollection;
 cqlsh:os_test1 alter table thetable add mycollection maptext,text;  
 Bad Request: comparators do not match or are not compatible.
 {quote}



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


[jira] [Commented] (CASSANDRA-6276) CQL: Map can not be created with the same name as a previously dropped list

2014-08-04 Thread Aleksey Yeschenko (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-6276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14084919#comment-14084919
 ] 

Aleksey Yeschenko commented on CASSANDRA-6276:
--

bq. In the longer run, one way to maybe fix this would be to push 
dropped_columns down to the sstable reading level. If we were skipping cells as 
soon as they are deserialized before they ever hit any comparator we would be 
free to update the comparator. Probably messy/inefficient to do with the 
current code, but might become feasible with 3.0 storage engine changes, we'll 
see. 

True. Would still be tricky somewhat, given that schema updates don't propagate 
instantly, but we'll see.

 CQL: Map can not be created with the same name as a previously dropped list
 ---

 Key: CASSANDRA-6276
 URL: https://issues.apache.org/jira/browse/CASSANDRA-6276
 Project: Cassandra
  Issue Type: Bug
 Environment:  Cassandra 2.0.2 | CQL spec 3.1.0
 centos 64 bit
 Java(TM) SE Runtime Environment (build 1.7.0-b147)
Reporter: Oli Schacher
Assignee: Benjamin Lerer
Priority: Minor
  Labels: cql
 Fix For: 2.1.1

 Attachments: CASSANDRA-6276.txt


 If create a list, drop it and create a map with the same name, i get Bad 
 Request: comparators do not match or are not compatible.
 {quote}
 cqlsh:os_test1 create table thetable(id timeuuid primary key, somevalue 
 text);
 cqlsh:os_test1 alter table thetable add mycollection listtext;  
 cqlsh:os_test1 alter table thetable drop mycollection;
 cqlsh:os_test1 alter table thetable add mycollection maptext,text;  
 Bad Request: comparators do not match or are not compatible.
 {quote}



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


[jira] [Commented] (CASSANDRA-6276) CQL: Map can not be created with the same name as a previously dropped list

2014-08-04 Thread Benedict (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-6276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14084921#comment-14084921
 ] 

Benedict commented on CASSANDRA-6276:
-

3.0 storage engine won't be universal for a while (maybe never for thrift), but 
will index directly into columns (i.e. won't touch any not requested), so could 
trivially avoid retrieving data for dropped columns. The only problem is we'd 
need to track the range of sstables for which they were previously dropped (and 
maybe contains stale data), and which we now apply the new comparator too, 
which would be a bit ugly/annoying.

 CQL: Map can not be created with the same name as a previously dropped list
 ---

 Key: CASSANDRA-6276
 URL: https://issues.apache.org/jira/browse/CASSANDRA-6276
 Project: Cassandra
  Issue Type: Bug
 Environment:  Cassandra 2.0.2 | CQL spec 3.1.0
 centos 64 bit
 Java(TM) SE Runtime Environment (build 1.7.0-b147)
Reporter: Oli Schacher
Assignee: Benjamin Lerer
Priority: Minor
  Labels: cql
 Fix For: 2.1.1

 Attachments: CASSANDRA-6276.txt


 If create a list, drop it and create a map with the same name, i get Bad 
 Request: comparators do not match or are not compatible.
 {quote}
 cqlsh:os_test1 create table thetable(id timeuuid primary key, somevalue 
 text);
 cqlsh:os_test1 alter table thetable add mycollection listtext;  
 cqlsh:os_test1 alter table thetable drop mycollection;
 cqlsh:os_test1 alter table thetable add mycollection maptext,text;  
 Bad Request: comparators do not match or are not compatible.
 {quote}



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


[jira] [Commented] (CASSANDRA-6276) CQL: Map can not be created with the same name as a previously dropped list

2014-07-31 Thread Aleksey Yeschenko (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-6276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14080816#comment-14080816
 ] 

Aleksey Yeschenko commented on CASSANDRA-6276:
--

Unfortunately, we can't allow dropping a component from the comparator, 
including dropping individual collection columns from ColumnToCollectionType.

If we do allow that, and have pre-existing data of that type, C* simply 
wouldn't know how to compare those:

{code:title=ColumnToCollectionType.java}
public int compareCollectionMembers(ByteBuffer o1, ByteBuffer o2, 
ByteBuffer collectionName)
{
CollectionType t = defined.get(collectionName);
if (t == null)
throw new 
RuntimeException(ByteBufferUtil.bytesToHex(collectionName) +  is not defined 
as a collection);

return t.nameComparator().compare(o1, o2);
}
{code}

A simple algorithm to hit the RTE:
1. create table test (id int primary key, col1 mapint, int, col2 setint);
2. insert into test (id, col1, col2) VALUES ( 0, \{0:0, 1:1\}, \{0,1\});
3. flush
4. update test set col1 = col1 + \{2:2\}, col2 = col2 + \{2\} where id = 0;
5. flush
6. select * from test;

{noformat}
java.lang.RuntimeException: 636f6c31 is not defined as a collection
at 
org.apache.cassandra.db.marshal.ColumnToCollectionType.compareCollectionMembers(ColumnToCollectionType.java:79)
 ~[main/:na]
at 
org.apache.cassandra.db.composites.CompoundSparseCellNameType$WithCollection.compare(CompoundSparseCellNameType.java:296)
 ~[main/:na]
at 
org.apache.cassandra.db.composites.AbstractCellNameType$1.compare(AbstractCellNameType.java:61)
 ~[main/:na]
at 
org.apache.cassandra.db.composites.AbstractCellNameType$1.compare(AbstractCellNameType.java:58)
 ~[main/:na]
at 
org.apache.cassandra.utils.MergeIterator$Candidate.compareTo(MergeIterator.java:154)
 ~[main/:na]
at 
org.apache.cassandra.utils.MergeIterator$Candidate.compareTo(MergeIterator.java:131)
 ~[main/:na]
{noformat}

For this reason alone we can't allow getting rid of a comparator component.

However, even if we did, and allowed to create a different collection with the 
same name, we'd hit a different issue: the new collection's comparator would be 
used to compare potentially incompatible types. Now, your unit tests aren't 
failing b/c most of our comparators assume valid values and don't perform extra 
validation, then use something like ByteBufferUtil.compareUnsigned() to compare 
the values, which doesn't fail and will just stop once the shortest BB gets 
exhausted. One exception is tuples/usertypes - they *do* expect at least length 
to be there, and will throw an exception.

Example:
1. create table test (id int primary key, col setboolean);
2. insert into test (id, col) values (0, \{true,false\});
3. alter table test drop col;
4. create type test (f1 int);
5. alter table test add col settest;
6. update test set col = col + \{ \{f1 : 0 \} \} where id = 0;
7. select * from test;

{noformat}
java.nio.BufferUnderflowException: null
at java.nio.Buffer.nextGetIndex(Buffer.java:498) ~[na:1.7.0_65]
at java.nio.HeapByteBuffer.getInt(HeapByteBuffer.java:355) 
~[na:1.7.0_65]
at org.apache.cassandra.db.marshal.TupleType.compare(TupleType.java:80) 
~[main/:na]
at org.apache.cassandra.db.marshal.TupleType.compare(TupleType.java:38) 
~[main/:na]
at 
org.apache.cassandra.db.marshal.ColumnToCollectionType.compareCollectionMembers(ColumnToCollectionType.java:81)
 ~[main/:na]
at 
org.apache.cassandra.db.composites.CompoundSparseCellNameType$WithCollection.compare(CompoundSparseCellNameType.java:296)
 ~[main/:na]
at 
org.apache.cassandra.db.composites.AbstractCellNameType$1.compare(AbstractCellNameType.java:61)
 ~[main/:na]
at 
org.apache.cassandra.db.composites.AbstractCellNameType$1.compare(AbstractCellNameType.java:58)
 ~[main/:na]
at 
org.apache.cassandra.utils.MergeIterator$Candidate.compareTo(MergeIterator.java:154)
 ~[main/:na]
{noformat}

 CQL: Map can not be created with the same name as a previously dropped list
 ---

 Key: CASSANDRA-6276
 URL: https://issues.apache.org/jira/browse/CASSANDRA-6276
 Project: Cassandra
  Issue Type: Bug
 Environment:  Cassandra 2.0.2 | CQL spec 3.1.0
 centos 64 bit
 Java(TM) SE Runtime Environment (build 1.7.0-b147)
Reporter: Oli Schacher
Assignee: Benjamin Lerer
Priority: Minor
  Labels: cql
 Fix For: 2.1.1

 Attachments: CASSANDRA-6276.txt


 If create a list, drop it and create a map with the same name, i get Bad 
 Request: comparators do not match or are not compatible.
 {quote}
 cqlsh:os_test1 create table thetable(id timeuuid primary key, somevalue 
 text);
 cqlsh:os_test1 

[jira] [Commented] (CASSANDRA-6276) CQL: Map can not be created with the same name as a previously dropped list

2014-06-05 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-6276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14019261#comment-14019261
 ] 

Jonathan Ellis commented on CASSANDRA-6276:
---

/cc [~slebresne]

 CQL: Map can not be created with the same name as a previously dropped list
 ---

 Key: CASSANDRA-6276
 URL: https://issues.apache.org/jira/browse/CASSANDRA-6276
 Project: Cassandra
  Issue Type: Bug
 Environment:  Cassandra 2.0.2 | CQL spec 3.1.0
 centos 64 bit
 Java(TM) SE Runtime Environment (build 1.7.0-b147)
Reporter: Oli Schacher
Priority: Minor

 If create a list, drop it and create a map with the same name, i get Bad 
 Request: comparators do not match or are not compatible.
 {quote}
 cqlsh:os_test1 create table thetable(id timeuuid primary key, somevalue 
 text);
 cqlsh:os_test1 alter table thetable add mycollection listtext;  
 cqlsh:os_test1 alter table thetable drop mycollection;
 cqlsh:os_test1 alter table thetable add mycollection maptext,text;  
 Bad Request: comparators do not match or are not compatible.
 {quote}



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


[jira] [Commented] (CASSANDRA-6276) CQL: Map can not be created with the same name as a previously dropped list

2014-01-23 Thread Daniel Smedegaard Buus (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-6276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13879828#comment-13879828
 ] 

Daniel Smedegaard Buus commented on CASSANDRA-6276:
---

This is quite frustrating when developing and debugging with large portions of 
data that need to be re-inserted every time you have a schema change because 
you have to drop an entire CF to make minor schema changes like this...

Is there a workaround one could use until this is resolved?

Thanks :)

 CQL: Map can not be created with the same name as a previously dropped list
 ---

 Key: CASSANDRA-6276
 URL: https://issues.apache.org/jira/browse/CASSANDRA-6276
 Project: Cassandra
  Issue Type: Bug
 Environment:  Cassandra 2.0.2 | CQL spec 3.1.0
 centos 64 bit
 Java(TM) SE Runtime Environment (build 1.7.0-b147)
Reporter: Oli Schacher
Priority: Minor

 If create a list, drop it and create a map with the same name, i get Bad 
 Request: comparators do not match or are not compatible.
 {quote}
 cqlsh:os_test1 create table thetable(id timeuuid primary key, somevalue 
 text);
 cqlsh:os_test1 alter table thetable add mycollection listtext;  
 cqlsh:os_test1 alter table thetable drop mycollection;
 cqlsh:os_test1 alter table thetable add mycollection maptext,text;  
 Bad Request: comparators do not match or are not compatible.
 {quote}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)


[jira] [Commented] (CASSANDRA-6276) CQL: Map can not be created with the same name as a previously dropped list

2013-10-31 Thread Brandon Williams (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-6276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13810230#comment-13810230
 ] 

Brandon Williams commented on CASSANDRA-6276:
-

I think we're looking at CASSANDRA-5202 here.

 CQL: Map can not be created with the same name as a previously dropped list
 ---

 Key: CASSANDRA-6276
 URL: https://issues.apache.org/jira/browse/CASSANDRA-6276
 Project: Cassandra
  Issue Type: Bug
 Environment:  Cassandra 2.0.2 | CQL spec 3.1.0
 centos 64 bit
 Java(TM) SE Runtime Environment (build 1.7.0-b147)
Reporter: Oli Schacher
Priority: Minor

 If create a list, drop it and create a map with the same name, i get Bad 
 Request: comparators do not match or are not compatible.
 {quote}
 cqlsh:os_test1 create table thetable(id timeuuid primary key, somevalue 
 text);
 cqlsh:os_test1 alter table thetable add mycollection listtext;  
 cqlsh:os_test1 alter table thetable drop mycollection;
 cqlsh:os_test1 alter table thetable add mycollection maptext,text;  
 Bad Request: comparators do not match or are not compatible.
 {quote}



--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (CASSANDRA-6276) CQL: Map can not be created with the same name as a previously dropped list

2013-10-31 Thread Jonathan Ellis (JIRA)

[ 
https://issues.apache.org/jira/browse/CASSANDRA-6276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13810242#comment-13810242
 ] 

Jonathan Ellis commented on CASSANDRA-6276:
---

5202 is drop/recreate of an entire table.

 CQL: Map can not be created with the same name as a previously dropped list
 ---

 Key: CASSANDRA-6276
 URL: https://issues.apache.org/jira/browse/CASSANDRA-6276
 Project: Cassandra
  Issue Type: Bug
 Environment:  Cassandra 2.0.2 | CQL spec 3.1.0
 centos 64 bit
 Java(TM) SE Runtime Environment (build 1.7.0-b147)
Reporter: Oli Schacher
Priority: Minor

 If create a list, drop it and create a map with the same name, i get Bad 
 Request: comparators do not match or are not compatible.
 {quote}
 cqlsh:os_test1 create table thetable(id timeuuid primary key, somevalue 
 text);
 cqlsh:os_test1 alter table thetable add mycollection listtext;  
 cqlsh:os_test1 alter table thetable drop mycollection;
 cqlsh:os_test1 alter table thetable add mycollection maptext,text;  
 Bad Request: comparators do not match or are not compatible.
 {quote}



--
This message was sent by Atlassian JIRA
(v6.1#6144)