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

Doing a descending range still returns columns in ascending order

    XMLWordPrintableJSON

Details

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

    Description

      If I do

      result = table.getSliceFrom(row, "Standard1:col5", false, 2);
      cf = result.getColumnFamily("Standard1");

      I expect to get back columns in the order 5, 4, 3 (at the thrift level, it's turned into a list) but instead I get 3, 4, 5 because using a CF as the return vehicle re-sorts them by the standard comparator.

      The simplest solution is to allow user-defined column ordering as in CASSANDRA-185 and always return columns in that order (i.e., remove the ascending bool). This also allows us to make the columngroup fetching more efficient in the best case (deserializing one column at a time instead of a group at a time).

      OTOH using one index to allow fetching items relatively efficiently in either directly is cool. But my gut says it's relatively uncommon to want to access in both directions at once, and even more uncommon to not be able to do a reverse() on the client side (because of data volume, for instance). Forcing a separate CF for this special case of a special case might be worth the tradeoff.

      Attachments

        1. issue196.patchv4
          5 kB
          Jun Rao
        2. issue196.patchv3
          4 kB
          Jun Rao
        3. issue_196.patchv2
          4 kB
          Jun Rao
        4. 196-systest.patch
          0.6 kB
          Sandeep Tata

        Issue Links

          Activity

            People

              junrao Jun Rao
              jbellis Jonathan Ellis
              Jun Rao
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: