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

Handle special column name when upgrading from 2.2.19 to 3.0.29/3.11.15

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Not A Problem
    • None
    • CQL/Interpreter
    • None
    • All
    • None

    Description

      When I was migrating from 2.2.19 to 3.0.29/3.11.15, I noticed some of my columns could not be accessed because of the syntax problem. I had a column named "Is" in the 2.x. However, after the upgrade process, when I try to perform the same select command, it throws an exception since "Is" will be interpreted separately. 

      I observed this after my cluster was fully upgraded. I cannot downgrade it back to 2.2.19. I cannot rename this column directly either.

      Steps to reproduce

      Execute the following commands in Cassandra-2.2.19 (single node)

      CREATE KEYSPACE  ks WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 2 };
      CREATE TABLE IF NOT EXISTS ks.tb (c1 INT,c2 INT,c3 TEXT,rJr INT,c4 TEXT,c5 TEXT,ds INT, Is INT,
      PRIMARY KEY (c2, c5, c3, rJr, Is, c1, ds, c4 ));
      
      SELECT c2, ds, Is, c4 FROM ks.tb WHERE c2 = 1566089765 AND c5 = 'teststring1' AND c3 = 'teststring2' AND rJr = -1012111692; 
      
       c2 | ds | is | c4
      ----+----+----+----
      
      
      (0 rows)

      Then perform an upgrade to Cassandra-3.0.29/Cassandra-3.11.15

      // Do the same select
      SELECT c2, ds, Is, c4 FROM ks.tb WHERE c2 = 1566089765 AND c5 = 'teststring1' AND c3 = 'teststring2' AND rJr = -1012111692; 
      
      SyntaxException: line 1:15 no viable alternative at input 'Is' (SELECT c2, ds, [Is]...)

      The column still exists in the table, but I cannot access it.

      I am wondering whether I can directly rename it in the new version or get some prompts telling me to rename is before the upgrade process. "Is" is also not marked as a reserved word in the CQL Keywords doc).

      Any help is appreciated!

      Attachments

        Activity

          People

            Unassigned Unassigned
            kehan5800 Ke Han
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: