Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-15504

INT is incompatible with previous type SMALLINT

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Triage Needed
    • Normal
    • Resolution: Unresolved
    • None
    • Cluster/Schema
    • None
    • All
    • None

    Description

      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:

       

       

      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"

       

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            mtruscello Marcus Truscello
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: