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

2.2 Documentation conflicts with observed behavior

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Low
    • Resolution: Invalid
    • None
    • None
    • CentOS 6.6
      [cqlsh 5.0.1 | Cassandra 2.2.5 | CQL spec 3.3.1 | Native protocol v4]

    Description

      Cassandra 2.1 allowed you to LIMIT a COUNT and have it mean that the query would return as soon as it found enough rows to fulfill your limit.

      For example,

      SELECT COUNT(*)
      FROM some_table
      LIMIT 1
      

      would always return a count of 1 as long as there is at least one row in the table.

      I've noticed that Cassandra 2.2 no longer behaves in this way and yet the documentation continues to suggest otherwise:
      http://docs.datastax.com/en/cql/3.3/cql/cql_reference/select_r.html?scroll=reference_ds_d35_v2q_xj__specifying-rows-returned-using-limit

      Cassandra 2.2 seems to return the full count despite what you set the LIMIT to.

      Looking through the version changes, it seems likely that the changes for the following note might be related (from https://docs.datastax.com/en/cassandra/2.2/cassandra/features.html):

      Allow count(*) and count(1) to be use as normal aggregation
      count() can now be used in aggregation.
      

      If so, the related ticket seems to be https://issues.apache.org/jira/browse/CASSANDRA-10114.

      Attachments

        Activity

          People

            Unassigned Unassigned
            sudotliu Terry Liu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: