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

allow per-partition LIMIT clause in cql

Agile BoardAttach filesAttach ScreenshotBulk Copy AttachmentsBulk Move AttachmentsVotersWatch issueWatchersCreate sub-taskConvert to sub-taskMoveLinkCloneLabelsUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 3.6
    • None

    Description

      somewhat related to static columns (#6561) and slicing (#4851), it is desirable to apply a LIMIT on a per-partition rather than per-query basis, such as to retrieve the top (most recent, etc) N clustered values for each partition key, e.g.

      – for each league, keep a ranked list of users
      create table scores (league text, score int, player text, primary key(league, score, player) );

      – get the top 3 teams in each league:
      select * from scores staticlimit 3;

      this currently requires issuing one query per partition key, which is tedious if all the key partition key values are known and impossible if they aren't.

      Attachments

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            ifesdjeen Alex Petrov Assign to me
            jhalliday Jonathan Halliday
            Alex Petrov
            Sylvain Lebresne
            Votes:
            12 Vote for this issue
            Watchers:
            23 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment