Cassandra
  1. Cassandra
  2. CASSANDRA-4827

cqlsh --cql3 unable to describe CF created with cli

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Fix Version/s: 1.2.0 rc1
    • Component/s: Tools
    • Labels:

      Description

      created CF with cli:

      create column family playlists
      with key_validation_class = UUIDType
       and comparator = 'CompositeType(UTF8Type, UTF8Type, UTF8Type)'
       and default_validation_class = UUIDType;
      

      Then get this error with cqlsh:

      cqlsh:music> describe table playlists;
      
      /Users/jonathan/projects/cassandra/git-trunk/bin/../pylib/cqlshlib/cql3handling.py:771: UnexpectedTableStructure: Unexpected table structure; may not translate correctly to CQL. expected composite key CF to have column aliases, but found none
      /Users/jonathan/projects/cassandra/git-trunk/bin/../pylib/cqlshlib/cql3handling.py:794: UnexpectedTableStructure: Unexpected table structure; may not translate correctly to CQL. expected [u'KEY'] length to be 3, but it's 1. comparator='org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.UTF8Type)'
      CREATE TABLE playlists (
        "KEY" uuid PRIMARY KEY
      )
      
      1. 4827-1.2.txt
        8 kB
        Aleksey Yeschenko

        Activity

        Hide
        Jonathan Ellis added a comment -

        Have only tested in 1.1 since CASSANDRA-4823 is not yet done for trunk.

        Expected result would be

        CREATE TABLE playlists (
          key uuid,
          column1 text,
          column2 text,
          column3 text,
          column4 uuid
          PRIMARY KEY (key, column1, column2, column3)
        ) WITH COMPACT STORAGE
        

        (See column name "forging" in CFDefinition.)

        Show
        Jonathan Ellis added a comment - Have only tested in 1.1 since CASSANDRA-4823 is not yet done for trunk. Expected result would be CREATE TABLE playlists ( key uuid, column1 text, column2 text, column3 text, column4 uuid PRIMARY KEY (key, column1, column2, column3) ) WITH COMPACT STORAGE (See column name "forging" in CFDefinition.)
        Hide
        Aleksey Yeschenko added a comment -

        cql3 on trunk:

        cqlsh:music> describe table playlists;

        /Users/aleksey/Repos/ASF/cassandra/bin/../pylib/cqlshlib/cql3handling.py:1505: UnexpectedTableStructure: Unexpected table structure; may not translate correctly to CQL. Dynamic storage CF does not have UTF8Type added to comparator

        Show
        Aleksey Yeschenko added a comment - cql3 on trunk: cqlsh:music> describe table playlists; /Users/aleksey/Repos/ASF/cassandra/bin/../pylib/cqlshlib/cql3handling.py:1505: UnexpectedTableStructure: Unexpected table structure; may not translate correctly to CQL. Dynamic storage CF does not have UTF8Type added to comparator
        Hide
        Michael Kjellman added a comment -

        similar issue when trying to use COPY in cqlsh3. cf was created with cli

        /opt/cassandra/apache-cassandra-1.1.6/bin/../pylib/cqlshlib/cql3handling.py:771: UnexpectedTableStructure: Unexpected table structure; may not translate correctly to CQL. expected composite key CF to have column aliases, but found none
        /opt/cassandra/apache-cassandra-1.1.6/bin/../pylib/cqlshlib/cql3handling.py:794: UnexpectedTableStructure: Unexpected table structure; may not translate correctly to CQL. expected [u'KEY'] length to be 3, but it's 1. comparator='org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.IntegerType)'

        Show
        Michael Kjellman added a comment - similar issue when trying to use COPY in cqlsh3. cf was created with cli /opt/cassandra/apache-cassandra-1.1.6/bin/../pylib/cqlshlib/cql3handling.py:771: UnexpectedTableStructure: Unexpected table structure; may not translate correctly to CQL. expected composite key CF to have column aliases, but found none /opt/cassandra/apache-cassandra-1.1.6/bin/../pylib/cqlshlib/cql3handling.py:794: UnexpectedTableStructure: Unexpected table structure; may not translate correctly to CQL. expected [u'KEY'] length to be 3, but it's 1. comparator='org.apache.cassandra.db.marshal.CompositeType(org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.UTF8Type,org.apache.cassandra.db.marshal.IntegerType)'
        Hide
        Aleksey Yeschenko added a comment -

        4827-1.2 eliminates most if not all DESCRIBE issues in 1.2, no matter what kind of table we are dealing with.

        Show
        Aleksey Yeschenko added a comment - 4827-1.2 eliminates most if not all DESCRIBE issues in 1.2, no matter what kind of table we are dealing with.
        Hide
        Aleksey Yeschenko added a comment -

        Oh, and this only fixes DESCRIBE in CQL3 mode. Didn't bother with CQL2.

        Show
        Aleksey Yeschenko added a comment - Oh, and this only fixes DESCRIBE in CQL3 mode. Didn't bother with CQL2.
        Hide
        Jonathan Ellis added a comment -

        +1

        Show
        Jonathan Ellis added a comment - +1
        Hide
        Aleksey Yeschenko added a comment -

        Committed, thanks.

        Show
        Aleksey Yeschenko added a comment - Committed, thanks.

          People

          • Assignee:
            Aleksey Yeschenko
            Reporter:
            Jonathan Ellis
            Reviewer:
            Jonathan Ellis
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development