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

Select an element inside a UDT throws an index error

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

Details

    • Normal

    Description

      Create the following data model:

      CREATE TYPE address (
      street text,
      city text,
      zip_code int,
      phones set<text>
       );
       
      CREATE TYPE fullname (
      firstname text,
      lastname text
      );
      
      CREATE TABLE users (
      id uuid PRIMARY KEY,
      name FROZEN <fullname>,
      addresses map<text, FROZEN <address>>
      );
      
      INSERT INTO users (id, name) 
      VALUES (62c36092-82a1-3a00-93d1-46196ee77204, {firstname: 'Marie-Claude', lastname: 'Josset'});
      

      When trying to select a sub-field in the name type:

      SELECT name.lastname FROM users WHERE id=62c36092-82a1-3a00-93d1-46196ee77204;
      

      You get the following error:

      list index out of range
      

      Attachments

        1. 7891.txt
          0.7 kB
          Philip Thompson
        2. 7891-2.txt
          0.7 kB
          Philip Thompson
        3. 7891-3.txt
          0.6 kB
          Philip Thompson

        Issue Links

        Activity

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

          People

            philipthompson Philip Thompson Assign to me
            pmcfadin Patrick McFadin
            Philip Thompson
            Tom Hobbs
            Philip Thompson Philip Thompson
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment