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

Benedict Elliott Smith commented on CASSANDRA-15504:
----------------------------------------------------

This was previously a bug: while it's absolutely possible to reinterpret the 
data on disk as an {{INT}}, this isn't what happens, and the binary 
representations are not interpreted correctly automatically.  The entirety of 
our type management in this regard could do with modernising, as it should 
anyway be possible to re-add columns as often as you like, with whatever type 
you like, but in a distributed system this is more hassle than you might 
imagine.

We'd more than welcome a contribution moving in the direction of this, but my 
prediction is that the active contributor community does not have the resources 
to dedicate to this specific issue at present.

It might be that there is some middle ground that could be achieved more 
readily, at least with a convenience mechanism for force re-add after expunging 
the old data via compaction.  But again, I don't think this is a priority, so 
you would have to take a look yourself.

> INT is incompatible with previous type SMALLINT
> -----------------------------------------------
>
>                 Key: CASSANDRA-15504
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-15504
>             Project: Cassandra
>          Issue Type: Bug
>            Reporter: Marcus Truscello
>            Priority: Normal
>
> With the release of Cassandra 3.11.5 and the fixing of CASSANDRA-14948, it 
> now appears that you can no longer re-add a SMALLINT column as an INT type.  
> This is rather surprising as any SMALLINT value should be representable by an 
> INT type.
> The following example was run on Cassandra 3.11.5 on CentOS 7 installed from 
> official RedHat repo:
>  
>  
> {noformat}
> cqlsh> CREATE KEYSPACE demo WITH replication = {'class':'SimpleStrategy', 
> 'replication_factor' : 1};
> cqlsh> CREATE TABLE demo.demo_table (
>    ...   user_id BIGINT,
>    ...   created TIMESTAMP,
>    ...   points  SMALLINT,
>    ...   PRIMARY KEY (user_id, created)
>    ... ) WITH CLUSTERING ORDER BY (created DESC);
> cqlsh> ALTER TABLE demo.demo_table DROP points;
> cqlsh> ALTER TABLE demo.demo_table ADD  points INT;
> InvalidRequest: Error from server: code=2200 [Invalid query] message="Cannot 
> re-add previously dropped column 'points' of type int, incompatible with 
> previous type smallint"{noformat}
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to