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

Select an element inside a UDT throws an index error

    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

            People

              philipthompson Philip Thompson
              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: