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

cql3 ORDER BY not ordering

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 1.1.1
    • None
    • Normal

    Description

      Creating the simplest composite-key cql3 table I can think of, populating it with a few rows of data, then trying to do a query with an ORDER BY does not yield ordered results.

      Here's a cql script:

      create keyspace test with strategy_class = 'SimpleStrategy'
         and strategy_options:replication_factor = 1;
      use test;
      create table moo (a int, b int, c int, primary key (a, b));
      
      insert into moo (a, b, c) values (123, 12, 3400);
      insert into moo (a, b, c) values (122, 13, 3500);
      insert into moo (a, b, c) values (124, 10, 3600);
      insert into moo (a, b, c) values (121, 11, 3700);
      
      select * from moo;
      select * from moo order by b;
      

      Here is the output of those two queries:

       a   | b  | c
      -----+----+------
       121 | 11 | 3700
       122 | 13 | 3500
       124 | 10 | 3600
       123 | 12 | 3400
      
       a   | b  | c
      -----+----+------
       121 | 11 | 3700
       122 | 13 | 3500
       124 | 10 | 3600
       123 | 12 | 3400
      

      I also tried these using the bare thrift interface, to make sure it wasn't python-cql or cqlsh doing something stupid. Same results. Am I totally missing something important here about how this is supposed to work?

      Attachments

        1. 4246.txt
          2 kB
          Sylvain Lebresne
        2. 4246-2.txt
          2 kB
          Sylvain Lebresne

        Activity

          People

            slebresne Sylvain Lebresne
            thepaul paul cannon
            Sylvain Lebresne
            Jonathan Ellis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: