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

ALTER TABLE ADD validation is overly strict for re-added collection columns

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • 3.0 alpha 1
    • None
    • None
    • Low

    Description

      AlterTableStatement ensures that we cannot re-add a collection column of a type that is incompatible with a previously existing, dropped one.

      It doesn't make an exception, however, for frozen collections, yet those should be allowed.

      Code in question:

      if (dropped != null && (dropped.type == null || (dropped.type instanceof CollectionType && !type.isCompatibleWith(dropped.type))))
          throw new InvalidRequestException(String.format("Cannot add a collection with the name %s " +
                      "because a collection with the same name and a different type%s has already been used in the past",
                      columnName, dropped.type == null ? "" : " (" + dropped.type.asCQL3Type() + ")"));
      

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            aleksey Aleksey Yeschenko Assign to me
            aleksey Aleksey Yeschenko
            Aleksey Yeschenko
            Tom Hobbs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment