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

CQL Not Handling Descending Clustering Order On A timeuuid Correctly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Fix Version/s: 1.2.4
    • Component/s: None
    • Labels:
      None
    • Environment:

      Apache Cassandra 1.2.3, Mac OS X (Lion), cql 3

    • Severity:
      Normal

      Description

      I raised this issue as a question in the mailing list:

      http://www.mail-archive.com/user@cassandra.apache.org/msg28787.html

      If I create a table (cqlsh) with the following schema:

      CREATE TABLE mytable ( column1 text,
      column2 text,
      messageId timeuuid,
      message blob,
      PRIMARY KEY ((column1, column2), messageId));

      I can quite happily add rows to this table:

      insert into client_queue (column1,column2,messageId,message) VALUES
      ('string1','string2',now(),'ABCCDCC123');

      If I however create a table with a desc clustering order on messageid:

      CREATE TABLE mytable ( column1 text,
      column2 text,
      messageId timeuuid,
      message blob,
      PRIMARY KEY ((column1, column2), messageId)) WITH CLUSTERING
      ORDER BY (messageId DESC);

      Inserts are failing. I am getting the following error:

      insert into client_queue2 (column1,column2,messageId,message) VALUES
      ('string1','string2',now(),'ABCCDCC123');

      I get the following error:

      Bad Request: Type error: cannot assign result of function now (type
      timeuuid) to messageid (type
      'org.apache.cassandra.db.marshal.ReversedType(org.apache.cassandra.db.marshal.TimeUUIDType)')

        Attachments

        1. 5386.txt
          6 kB
          Sylvain Lebresne

          Activity

            People

            • Assignee:
              slebresne Sylvain Lebresne
              Reporter:
              gcollins Gareth Collins
              Authors:
              Sylvain Lebresne
              Reviewers:
              Jonathan Ellis
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: