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

Reduce new reserved keywords introduced since 3.0

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 4.0-rc1, 4.0
    • CQL/Syntax
    • None
    • Operability
    • Normal
    • All
    • None
    • Hide

      Added KeywordTest that goes through the keyword tokens and checks creating, updating and selecting tables and materialized views with the keyword as the table/column names.

      Show
      Added KeywordTest that goes through the keyword tokens and checks creating, updating and selecting tables and materialized views with the keyword as the table/column names.

    Description

      Building on CASSANDRA-16398, for users upgrading from 3.0 to 4.0 there have been a few new reserved keywords added that can cause problems with schema changes and queries in existing applications. Reducing the number of new reserved words makes upgrades easier for users.

      K_DEFAULT
      K_MBEAN
      K_MBEANS
      K_NEGATIVE_INFINITY
      K_NEGATIVE_NAN
      K_POSITIVE_INFINITY
      K_POSITIVE_NAN
      K_REPLACE
      K_SCHEMA
      K_UNSET
      

      I think they can all be removed from the ReservedWords lists (where present) and added to basic_unreserved_keyword with the exception of the NAN and INFINITY as there could be ambiguity between a selected field and a nan/infinity literal.

      To validate I've written a test that extracts the keywords from the parser tokens and verifies that any non-reserved keywords can be used as table and column names for regular tables and materialized views. It isn't exhaustive but provides a good sense check.

      Attachments

        Issue Links

          Activity

            People

              jmeredithco Jon Meredith
              jmeredithco Jon Meredith
              Jon Meredith
              Alex Petrov, David Capwell, Yifan Cai
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m