Cassandra
  1. Cassandra
  2. CASSANDRA-4645

(CQL3) Re-allow order by on non-selected columns

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Fix Version/s: 1.2.0 beta 2
    • Component/s: None
    • Labels:
      None

      Description

      CASSANDRA-4612 added a limitation to ORDER BY query in that it requires the columns part of the ORDER BY to be in the select clause, while this wasn't the case previously.

      The reason for that is that for ORDER BY with IN queries, the sorting is done post-query, and by the time we do the ordering, we've already cut down the result set to the select clause, so if the column are not in the select clause we cannot sort on them.

      We should remove that that limitation however as this is a regression from what we had before. As far as 1.2.0 is concerned, at the very least we should lift the limitation for EQ queries since we don't do any post-query sorting in that case and that was working correctly pre-CASSANDRA-4612. But we should also remove that limitation for IN query, even if it's in a second time.

      1. 4645.txt
        2 kB
        Sylvain Lebresne

        Activity

        Hide
        Sylvain Lebresne added a comment -

        Attaching trivial patch to fix the limitation introduced by CASSANDRA-4612. I.e. it doesn't force the order by columns to be select, unless this is an IN query. I've opened CASSANDRA-4911 to remove the limitation for IN queries, but that part has never worked anyway so it's more of an improvement.

        Show
        Sylvain Lebresne added a comment - Attaching trivial patch to fix the limitation introduced by CASSANDRA-4612 . I.e. it doesn't force the order by columns to be select, unless this is an IN query. I've opened CASSANDRA-4911 to remove the limitation for IN queries, but that part has never worked anyway so it's more of an improvement.
        Hide
        Jonathan Ellis added a comment -

        +1

        Show
        Jonathan Ellis added a comment - +1
        Hide
        Sylvain Lebresne added a comment -

        Committed, thanks

        Show
        Sylvain Lebresne added a comment - Committed, thanks

          People

          • Assignee:
            Sylvain Lebresne
            Reporter:
            Sylvain Lebresne
            Reviewer:
            Jonathan Ellis
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development