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

SELECT count within a partition does not respect LIMIT

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • None
    • Legacy/CQL
    • None
    • Low

    Description

      cassandra@cqlsh> create KEYSPACE test WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};
      cassandra@cqlsh> use test;
      cassandra@cqlsh:test> create table t (k int, c int, v int, primary key (k, c));
      cassandra@cqlsh:test> INSERT INTO t (k, c, v) VALUES (0, 0, 0);
      cassandra@cqlsh:test> INSERT INTO t (k, c, v) VALUES (0, 1, 0);
      cassandra@cqlsh:test> INSERT INTO t (k, c, v) VALUES (0, 2, 0);
      cassandra@cqlsh:test> select * from t where k = 0;
      
       k | c | v
      ---+---+---
       0 | 0 | 0
       0 | 1 | 0
       0 | 2 | 0
      
      (3 rows)
      cassandra@cqlsh:test> select count(*) from t where k = 0 limit 2;
      
       count
      -------
           3
      
      (1 rows)
      

      Expected: count should return 2, according to limit.
      Actual: count of all rows in partition

      This manifests in 3.0, does not appear in 2.2

      Attachments

        1. 10380.txt
          2 kB
          Benjamin Lerer

        Activity

          People

            blerer Benjamin Lerer
            aholmber Adam Holmberg
            Benjamin Lerer
            Sylvain Lebresne
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: